Add feature for send data for decrypt image on onImage() method

This commit is contained in:
kiv1n 2016-08-24 20:52:02 +03:00
parent c12b136b76
commit 8e92eaedc2
1 changed files with 5 additions and 1 deletions

View File

@ -298,7 +298,11 @@ class Session(YowsupApp):
participant = image.participant
if image.caption is None:
image.caption = ''
message = image.url + ' ' + image.caption
# Add to message data for descrypt
iv, cipherKey = image.getDecryptData();
ivHexString = "".join("{:02x}".format(ord(c)) for c in iv)
cipherKeyHexString = "".join("{:02x}".format(ord(c)) for c in cipherKey)
message = image.url + ';' + ivHexString + ';' + cipherKeyHexString
if participant is not None: # Group message
partname = participant.split('@')[0]
self.sendGroupMessageToXMPP(buddy, partname, message, image.timestamp)