don't reconnect twice when connection is lost

This commit is contained in:
Yann Leboulanger 2015-07-26 14:05:47 +02:00
parent 759234f451
commit f74c83535f
1 changed files with 2 additions and 0 deletions

View File

@ -885,6 +885,7 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connection.disconnect()
self.last_connection = None
self.connection = None
def set_oldst(self): # Set old state
if self.old_show:
self.connected = gajim.SHOW_LIST.index(self.old_show)
@ -913,6 +914,7 @@ class Connection(CommonConnection, ConnectionHandlers):
self.sm.enabled = False
gajim.nec.push_incoming_event(OurShowEvent(None, conn=self,
show='error'))
self.connection.UnregisterDisconnectHandler(self._disconnectedReconnCB)
self.disconnect()
if gajim.config.get_per('accounts', self.name, 'autoreconnect'):
self.connected = -1