entity capabilities for groupchat contacts. fixes #4033

This commit is contained in:
Yann Leboulanger 2008-06-27 15:07:15 +00:00
parent a9877f14dd
commit db09ad11d7
1 changed files with 10 additions and 6 deletions

View File

@ -207,10 +207,11 @@ class ConnectionCaps(object):
gajim.capscache.preload(self, jid, node, hash_method, hash) gajim.capscache.preload(self, jid, node, hash_method, hash)
contact = gajim.contacts.get_contact_from_full_jid(self.name, jid) contact = gajim.contacts.get_contact_from_full_jid(self.name, jid)
if contact in [None, []]: 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 return # TODO: a way to put contact not-in-roster into Contacts
elif isinstance(contact, list):
contact = contact[0]
# overwriting old data # overwriting old data
contact.caps_node = node contact.caps_node = node
@ -220,6 +221,9 @@ class ConnectionCaps(object):
def _capsDiscoCB(self, jid, node, identities, features, dataforms): def _capsDiscoCB(self, jid, node, identities, features, dataforms):
contact = gajim.contacts.get_contact_from_full_jid(self.name, jid) contact = gajim.contacts.get_contact_from_full_jid(self.name, jid)
if not contact: if not contact:
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 return
if not contact.caps_node: if not contact.caps_node:
return # we didn't asked for that? return # we didn't asked for that?