fix session problem when other part don't support sessions. Fixes #4429

This commit is contained in:
Yann Leboulanger 2008-11-29 18:50:03 +00:00
parent 766284354c
commit 8907f71c86
1 changed files with 9 additions and 3 deletions

View File

@ -2179,11 +2179,17 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
keyID, timestamp, None)) keyID, timestamp, None))
if ptype == 'unavailable' and jid_stripped in self.sessions: if ptype == 'unavailable' and jid_stripped in self.sessions:
# automatically terminate sessions that they haven't sent a thread ID in # automatically terminate sessions that they haven't sent a thread ID
# in, only if other part support thread ID
for sess in self.sessions[jid_stripped].values(): for sess in self.sessions[jid_stripped].values():
if not sess.received_thread_id: if not sess.received_thread_id:
sess.terminate() contact = gajim.contacts.get_contact(self.name, jid_stripped)
del self.sessions[jid_stripped][sess.thread_id]
session_supported = gajim.capscache.is_supported(contact,
common.xmpp.NS_ESESSION)
if session_supported:
sess.terminate()
del self.sessions[jid_stripped][sess.thread_id]
if avatar_sha is not None and ptype != 'error': if avatar_sha is not None and ptype != 'error':
if jid_stripped not in self.vcard_shas: if jid_stripped not in self.vcard_shas: