changeset d84143872a64 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=d84143872a64 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 b7c4f2c2e73f -r d84143872a64 src/common/connection_handlers.py --- a/src/common/connection_handlers.py Sun Mar 06 22:43:54 2016 +0100 +++ b/src/common/connection_handlers.py Tue Mar 08 22:36:22 2016 +0100 @@ -1196,13 +1196,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: