changeset ed8f0555d852 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=ed8f0555d852 description: handle message receipts corretly, even if they don't have the <thread> element
diffstat:
src/common/connection_handlers.py | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-)
diffs (32 lines):
diff -r 6702c61c7093 -r ed8f0555d852 src/common/connection_handlers.py --- a/src/common/connection_handlers.py Sat Mar 05 15:48:51 2016 +0100 +++ b/src/common/connection_handlers.py Tue Mar 08 22:36:22 2016 +0100 @@ -1194,13 +1194,21 @@ self.connection.send(receipt)
# We got our message's receipt - if obj.receipt_received_tag and obj.session.control and \ - gajim.config.get_per('accounts', self.name, 'request_receipt'): - id_ = obj.receipt_received_tag.getAttr('id') - if not id_: - # old XEP implementation - id_ = obj.id_ - obj.session.control.conv_textview.hide_xep0184_warning(id_) + if obj.receipt_received_tag and gajim.config.get_per('accounts', + 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') + if not id_: + # old XEP implementation + id_ = obj.id_ + ctrl.conv_textview.hide_xep0184_warning(id_)
if obj.mtype == 'error': if not obj.msgtxt: