From c24041a0df8f1309ab2220f9573bcb2e23bac222 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 14 Jul 2008 00:25:53 +0000 Subject: [PATCH] moved receipt handling after XEP 0200 decryption --- src/common/connection_handlers.py | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 892f53ace..da85d5d0f 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1661,23 +1661,6 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, encrypted = False xep_200_encrypted = msg.getTag('c', namespace=common.xmpp.NS_STANZA_CRYPTO) - # Receipt requested - # TODO: We shouldn't answer if we're invisible! - contact = gajim.contacts.get_contact(self.name, - common.gajim.get_room_and_nick_from_fjid(frm)[0]) - if msg.getTag('request', namespace=common.xmpp.NS_RECEIPTS) \ - and gajim.config.get_per('accounts', self.name, - 'answer_receipts') and contact and contact.sub \ - not in (u'to', u'none'): - receipt = common.xmpp.Message(to = jid, typ = 'chat') - receipt.setID(msg.getID()) - receipt.setTag('received', - namespace='urn:xmpp:receipts') - - if thread_id: - receipt.setThread(thread_id) - con.send(receipt) - if mtype != 'groupchat': session = self.get_or_create_session(frm, thread_id) @@ -1729,6 +1712,23 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, except: self.dispatch('FAILED_DECRYPT', (frm, tim, session)) + # Receipt requested + # TODO: We shouldn't answer if we're invisible! + contact = gajim.contacts.get_contact(self.name, + common.gajim.get_room_and_nick_from_fjid(frm)[0]) + if msg.getTag('request', namespace=common.xmpp.NS_RECEIPTS) \ + and gajim.config.get_per('accounts', self.name, + 'answer_receipts') and contact and contact.sub \ + not in (u'to', u'none'): + receipt = common.xmpp.Message(to = jid, typ = 'chat') + receipt.setID(msg.getID()) + receipt.setTag('received', + namespace='urn:xmpp:receipts') + + if thread_id: + receipt.setThread(thread_id) + con.send(receipt) + addressTag = msg.getTag('addresses', namespace = common.xmpp.NS_ADDRESS) # Be sure it comes from one of our resource, else ignore address element