remove failure handler, after we call it

This commit is contained in:
Dimitur Kirov 2006-04-28 16:20:24 +00:00
parent 94c1f17538
commit 173c81ad8c
1 changed files with 4 additions and 1 deletions

View File

@ -134,7 +134,8 @@ class Connection(ConnectionHandlers):
self.dispatch('STATUS', 'offline') self.dispatch('STATUS', 'offline')
if not self.on_purpose: if not self.on_purpose:
self.disconnect() self.disconnect()
if gajim.config.get_per('accounts', self.name, 'autoreconnect'): if gajim.config.get_per('accounts', self.name, 'autoreconnect') \
and self.retrycount <= 10:
self.connected = 1 self.connected = 1
self.dispatch('STATUS', 'connecting') self.dispatch('STATUS', 'connecting')
self.time_to_reconnect = 10 self.time_to_reconnect = 10
@ -147,6 +148,7 @@ class Connection(ConnectionHandlers):
self.time_to_reconnect) self.time_to_reconnect)
elif self.on_connect_failure: elif self.on_connect_failure:
self.on_connect_failure() self.on_connect_failure()
self.on_connect_failure = None
else: else:
# show error dialog # show error dialog
self._connection_lost() self._connection_lost()
@ -340,6 +342,7 @@ class Connection(ConnectionHandlers):
self.time_to_reconnect = None self.time_to_reconnect = None
if self.on_connect_failure: if self.on_connect_failure:
self.on_connect_failure() self.on_connect_failure()
self.on_connect_failure = None
else: else:
# shown error dialog # shown error dialog
self._connection_lost() self._connection_lost()