From 8d37cec3b0245938ae77230dfd2d3e61e14da986 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 8 Mar 2016 22:36:22 +0100 Subject: [PATCH] handle message receipts corretly, even if they don't have the element --- src/common/connection_handlers.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 5834fb54b..5f32e1234 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1194,13 +1194,21 @@ class ConnectionHandlersBase: 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 doesn't have the 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: