From f92cdf02cb9dfc9b94d845853f48fed1dfe784d7 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 18 May 2005 14:05:54 +0000 Subject: [PATCH] set self.connected to 0 before dispatching the status to the GUI so the connectiing icon should disapear if connection failed --- src/common/connection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 05a209b03..ff0654148 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -521,9 +521,9 @@ class Connection: c = None if not c: gajim.log.debug('Couldn\'t connect to %s' % hostname) + self.connected = 0 self.dispatch('STATUS', 'offline') self.dispatch('ERROR', _('Couldn\'t connect to %s') % hostname) - self.connected = 0 return None con.RegisterHandler('message', self._messageCB) @@ -555,9 +555,9 @@ class Connection: try: auth = con.auth(name, self.password, resource) #FIXME: blocking except IOError: #probably a timeout + self.connected = 0 self.dispatch('STATUS', 'offline') self.dispatch('ERROR', _('Couldn\'t connect to %s') % hostname) - self.connected = 0 return None if auth: con.initRoster() @@ -565,9 +565,9 @@ class Connection: return con else: gajim.log.debug('Couldn\'t authentificate to %s' % hostname) + self.connected = 0 self.dispatch('STATUS', 'offline') self.dispatch('ERROR', _('Authentification failed with %s, check your login and password') % hostname) - self.connected = 0 return None # END connect