From 8907f71c86ba659be83a03c882ed690eac961602 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 29 Nov 2008 18:50:03 +0000 Subject: [PATCH] fix session problem when other part don't support sessions. Fixes #4429 --- src/common/connection_handlers.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 1aa57e95d..d8938240d 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -2179,11 +2179,17 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, keyID, timestamp, None)) 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(): if not sess.received_thread_id: - sess.terminate() - del self.sessions[jid_stripped][sess.thread_id] + contact = gajim.contacts.get_contact(self.name, jid_stripped) + + 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 jid_stripped not in self.vcard_shas: