set self.connected to 0 before dispatching the status to the GUI so the connectiing icon should disapear if connection failed
This commit is contained in:
parent
5b2d068c58
commit
f92cdf02cb
1 changed files with 3 additions and 3 deletions
|
@ -521,9 +521,9 @@ class Connection:
|
||||||
c = None
|
c = None
|
||||||
if not c:
|
if not c:
|
||||||
gajim.log.debug('Couldn\'t connect to %s' % hostname)
|
gajim.log.debug('Couldn\'t connect to %s' % hostname)
|
||||||
|
self.connected = 0
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', _('Couldn\'t connect to %s') % hostname)
|
self.dispatch('ERROR', _('Couldn\'t connect to %s') % hostname)
|
||||||
self.connected = 0
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
con.RegisterHandler('message', self._messageCB)
|
con.RegisterHandler('message', self._messageCB)
|
||||||
|
@ -555,9 +555,9 @@ class Connection:
|
||||||
try:
|
try:
|
||||||
auth = con.auth(name, self.password, resource) #FIXME: blocking
|
auth = con.auth(name, self.password, resource) #FIXME: blocking
|
||||||
except IOError: #probably a timeout
|
except IOError: #probably a timeout
|
||||||
|
self.connected = 0
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', _('Couldn\'t connect to %s') % hostname)
|
self.dispatch('ERROR', _('Couldn\'t connect to %s') % hostname)
|
||||||
self.connected = 0
|
|
||||||
return None
|
return None
|
||||||
if auth:
|
if auth:
|
||||||
con.initRoster()
|
con.initRoster()
|
||||||
|
@ -565,9 +565,9 @@ class Connection:
|
||||||
return con
|
return con
|
||||||
else:
|
else:
|
||||||
gajim.log.debug('Couldn\'t authentificate to %s' % hostname)
|
gajim.log.debug('Couldn\'t authentificate to %s' % hostname)
|
||||||
|
self.connected = 0
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', _('Authentification failed with %s, check your login and password') % hostname)
|
self.dispatch('ERROR', _('Authentification failed with %s, check your login and password') % hostname)
|
||||||
self.connected = 0
|
|
||||||
return None
|
return None
|
||||||
# END connect
|
# END connect
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue