From db09ad11d7ba8f61204b64215576d2b058bfca79 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 27 Jun 2008 15:07:15 +0000 Subject: [PATCH] entity capabilities for groupchat contacts. fixes #4033 --- src/common/caps.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/common/caps.py b/src/common/caps.py index c611ffbf0..4ed22c90e 100644 --- a/src/common/caps.py +++ b/src/common/caps.py @@ -206,11 +206,12 @@ class ConnectionCaps(object): # start disco query... gajim.capscache.preload(self, jid, node, hash_method, hash) - contact=gajim.contacts.get_contact_from_full_jid(self.name, jid) - if contact in [None, []]: - return # TODO: a way to put contact not-in-roster into Contacts - elif isinstance(contact, list): - contact = contact[0] + contact = gajim.contacts.get_contact_from_full_jid(self.name, jid) + if contact is None: + room_jid, nick = gajim.get_room_and_nick_from_fjid(jid) + contact = gajim.contacts.get_gc_contact(self.name, room_jid, nick) + if contact is None: + return # TODO: a way to put contact not-in-roster into Contacts # overwriting old data contact.caps_node = node @@ -220,7 +221,10 @@ class ConnectionCaps(object): def _capsDiscoCB(self, jid, node, identities, features, dataforms): contact = gajim.contacts.get_contact_from_full_jid(self.name, jid) if not contact: - return + room_jid, nick = gajim.get_room_and_nick_from_fjid(jid) + contact = gajim.contacts.get_gc_contact(self.name, room_jid, nick) + if contact is None: + return if not contact.caps_node: return # we didn't asked for that? if not node.startswith(contact.caps_node + '#'):