Author: js Date: 2008-07-02 12:48:15 +0200 (Wed, 02 Jul 2008) New Revision: 9874
Modified: trunk/src/common/connection.py Log: XEP-0184 uses the new caps-checking way now.
Modified: trunk/src/common/connection.py =================================================================== --- trunk/src/common/connection.py 2008-07-02 09:20:49 UTC (rev 9873) +++ trunk/src/common/connection.py 2008-07-02 10:48:15 UTC (rev 9874) @@ -1101,6 +1101,16 @@ msg_iq.setTag('nick', namespace = common.xmpp.NS_NICK).setData( user_nick)
+ # TODO: We might want to write a function so we don't need to + # reproduce that ugly if somewhere else. + if resource: + contact = gajim.contacts.get_contact(self.name, jid, + resource) + else: + contact = gajim.contacts. \ + get_contact_with_highest_priority(self.name, + jid) + # chatstates - if peer supports xep85 or xep22, send chatstates # please note that the only valid tag inside a message containing a <body> # tag is the active event @@ -1123,17 +1133,9 @@ 'jid': forward_from})
# XEP-0184 - if resource: - contact = gajim.contacts.get_contact(self.name, jid, - resource) - else: - contact = gajim.contacts. \ - get_contact_with_highest_priority(self.name, - jid) if msgtxt and gajim.config.get_per('accounts', self.name, - 'request_receipt') and common.xmpp.NS_RECEIPTS in \ - gajim.capscache[(contact.caps_hash_method, - contact.caps_hash)].features: + 'request_receipt') and gajim.capscache.is_supported(contact, + common.xmpp.NS_RECEIPTS: msg_iq.setTag('request', namespace=common.xmpp.NS_RECEIPTS)