while we connect, after connect and after auth, we check if user hasen't changed his mind and choose to go offline

This commit is contained in:
Yann Leboulanger 2005-10-07 09:55:29 +00:00
parent b325e15756
commit 2b1d4c93b5

View file

@ -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)