Author: bct Date: 2008-07-14 02:25:53 +0200 (Mon, 14 Jul 2008) New Revision: 9925
Modified: trunk/src/common/connection_handlers.py Log: moved receipt handling after XEP 0200 decryption
Modified: trunk/src/common/connection_handlers.py =================================================================== --- trunk/src/common/connection_handlers.py 2008-07-13 23:10:11 UTC (rev 9924) +++ trunk/src/common/connection_handlers.py 2008-07-14 00:25:53 UTC (rev 9925) @@ -1661,23 +1661,6 @@ 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 @@ 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