handle message receipts corretly, even if they don't have the <thread> element

This commit is contained in:
Yann Leboulanger 2016-03-08 22:36:22 +01:00
parent 47a7c0506a
commit 8d37cec3b0
1 changed files with 15 additions and 7 deletions

View File

@ -1194,13 +1194,21 @@ class ConnectionHandlersBase:
self.connection.send(receipt) self.connection.send(receipt)
# We got our message's receipt # We got our message's receipt
if obj.receipt_received_tag and obj.session.control and \ if obj.receipt_received_tag and gajim.config.get_per('accounts',
gajim.config.get_per('accounts', self.name, 'request_receipt'): self.name, 'request_receipt'):
ctrl = obj.session.control
if not ctrl:
# Received <message> doesn't have the <thread> element?
# search in all sessions
for s in self.get_sessions(obj.jid):
if s.control:
ctrl = s.control
if ctrl:
id_ = obj.receipt_received_tag.getAttr('id') id_ = obj.receipt_received_tag.getAttr('id')
if not id_: if not id_:
# old XEP implementation # old XEP implementation
id_ = obj.id_ id_ = obj.id_
obj.session.control.conv_textview.hide_xep0184_warning(id_) ctrl.conv_textview.hide_xep0184_warning(id_)
if obj.mtype == 'error': if obj.mtype == 'error':
if not obj.msgtxt: if not obj.msgtxt: