Changeset 10013
- Timestamp:
- 07/23/08 20:28:55 (6 weeks ago)
- Files:
-
- 1 modified
-
trunk/src/common/caps.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/caps.py
r9899 r10013 203 203 for xmpp registered in connection_handlers.py''' 204 204 205 # we will put these into proper Contact object and ask 206 # for disco... so that disco will learn how to interpret 207 # these caps 208 jid = helpers.get_full_jid_from_iq(presence) 209 contact = gajim.contacts.get_contact_from_full_jid( 210 self.name, jid) 211 if contact is None: 212 room_jid, nick = gajim.get_room_and_nick_from_fjid(jid) 213 contact = gajim.contacts.get_gc_contact( 214 self.name, room_jid, nick) 215 if contact is None: 216 # TODO: a way to put contact not-in-roster 217 # into Contacts 218 return 219 205 220 # get the caps element 206 221 caps = presence.getTag('c') 207 222 if not caps: 208 return 209 210 hash_method, node, hash = caps['hash'], caps['node'], caps['ver'] 223 contact.caps_node = None 224 contact.caps_hash = None 225 contact.hash_method = None 226 return 227 228 hash_method, node, hash = \ 229 caps['hash'], caps['node'], caps['ver'] 230 211 231 if hash_method is None or node is None or hash is None: 212 232 # improper caps in stanza, ignoring 213 return 214 215 # we will put these into proper Contact object and ask 216 # for disco... so that disco will learn how to interpret 217 # these caps 218 219 jid = helpers.get_full_jid_from_iq(presence) 233 contact.caps_node = None 234 contact.caps_hash = None 235 contact.hash_method = None 236 return 220 237 221 238 # start disco query... 222 239 gajim.capscache.preload(self, jid, node, hash_method, hash) 223 224 contact = gajim.contacts.get_contact_from_full_jid(self.name, jid)225 if contact is None:226 room_jid, nick = gajim.get_room_and_nick_from_fjid(jid)227 contact = gajim.contacts.get_gc_contact(self.name, room_jid, nick)228 if contact is None:229 return # TODO: a way to put contact not-in-roster into Contacts230 240 231 241 # overwriting old data
