Fixed Bug when receiving Audio or Video-Messages

This commit is contained in:
Nico 2017-06-06 15:17:50 -05:00
parent d85a554e15
commit ce70a912dd

View file

@ -325,6 +325,7 @@ class Session(YowsupApp):
self.logger.debug('Received %s message: %s' % (type, media))
buddy = media._from.split('@')[0]
participant = media.participant
caption = ''
if media.isEncrypted():
self.logger.debug('Received encrypted media message')
@ -341,6 +342,9 @@ class Session(YowsupApp):
else:
url = media.url
if type == 'image':
caption = media.caption
if participant is not None: # Group message
partname = participant.split('@')[0]
if media._from.split('@')[1] == 'broadcast': # Broadcast message
@ -353,6 +357,7 @@ class Session(YowsupApp):
else:
self.sendMessageToXMPP(buddy, url, media.timestamp)
self.sendMessageToXMPP(buddy, media.caption, media.timestamp)
self.sendReceipt(media._id, media._from, None, media.participant)
self.recvMsgIDs.append((media._id, media._from, media.participant, media.timestamp))