handle presences before caps. Fixes #6046

This commit is contained in:
Yann Leboulanger 2010-11-24 09:19:38 +01:00
parent 1c9d56e7de
commit c104199f6c
2 changed files with 7 additions and 2 deletions

View File

@ -1071,6 +1071,10 @@ ConnectionJingle, ConnectionIBBytestream):
ConnectionPubSub.__init__(self)
ConnectionPEP.__init__(self, account=self.name, dispatcher=self,
pubsub_connection=self)
# Handle presences BEFORE caps
gajim.nec.register_incoming_event(PresenceReceivedEvent)
ConnectionCaps.__init__(self, account=self.name,
dispatch_event=self.dispatch, capscache=capscache.capscache,
client_caps_factory=capscache.create_suitable_client_caps)
@ -1104,7 +1108,6 @@ ConnectionJingle, ConnectionIBBytestream):
PrivateStorageRosternotesReceivedEvent)
gajim.nec.register_incoming_event(RosternotesReceivedEvent)
gajim.nec.register_incoming_event(StreamConflictReceivedEvent)
gajim.nec.register_incoming_event(PresenceReceivedEvent)
gajim.nec.register_incoming_event(MessageReceivedEvent)
gajim.nec.register_incoming_event(ArchivingErrorReceivedEvent)
gajim.nec.register_incoming_event(

View File

@ -48,6 +48,8 @@ class ConnectionCaps(object):
self._account = new_name
def _nec_caps_presence_received(self, obj):
if obj.conn.name != self._account:
return
obj.client_caps = self._create_suitable_client_caps(obj.node,
obj.caps_hash, obj.hash_method)
self._capscache.query_client_of_jid_if_unknown(self, obj.fjid,