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:
parent
b325e15756
commit
2b1d4c93b5
1 changed files with 4 additions and 0 deletions
|
@ -1420,6 +1420,8 @@ class Connection:
|
||||||
# end of SRV resolver
|
# end of SRV resolver
|
||||||
|
|
||||||
con_type = con.connect((h, p), proxy=proxy, secure=secur)
|
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:
|
if not con_type:
|
||||||
gajim.log.debug("Couldn't connect to %s" % self.name)
|
gajim.log.debug("Couldn't connect to %s" % self.name)
|
||||||
if not self.retrycount:
|
if not self.retrycount:
|
||||||
|
@ -1486,6 +1488,8 @@ class Connection:
|
||||||
self.dispatch('ERROR', (_('Could not connect to "%s"') % self.name,
|
self.dispatch('ERROR', (_('Could not connect to "%s"') % self.name,
|
||||||
_('Check your connection or try again later')))
|
_('Check your connection or try again later')))
|
||||||
return None
|
return None
|
||||||
|
if not self.connected: # We went offline during connecting process
|
||||||
|
return None
|
||||||
if hasattr(con, 'Resource'):
|
if hasattr(con, 'Resource'):
|
||||||
self.server_resource = con.Resource
|
self.server_resource = con.Resource
|
||||||
con.RegisterEventHandler(self._event_dispatcher)
|
con.RegisterEventHandler(self._event_dispatcher)
|
||||||
|
|
Loading…
Add table
Reference in a new issue