From 2b1d4c93b543e805cc71fbc24780487f3f8d1586 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 7 Oct 2005 09:55:29 +0000 Subject: [PATCH] while we connect, after connect and after auth, we check if user hasen't changed his mind and choose to go offline --- src/common/connection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/connection.py b/src/common/connection.py index 7b6043500..b4469b930 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -1420,6 +1420,8 @@ class Connection: # end of SRV resolver con_type = con.connect((h, p), proxy=proxy, secure=secur) + if not self.connected: # We went offline during connecting process + return None if not con_type: gajim.log.debug("Couldn't connect to %s" % self.name) if not self.retrycount: @@ -1486,6 +1488,8 @@ class Connection: self.dispatch('ERROR', (_('Could not connect to "%s"') % self.name, _('Check your connection or try again later'))) return None + if not self.connected: # We went offline during connecting process + return None if hasattr(con, 'Resource'): self.server_resource = con.Resource con.RegisterEventHandler(self._event_dispatcher)