From b02cdd378d4dae12d71d13d883d0315067a81b64 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 31 Jan 2007 20:38:49 +0000 Subject: [PATCH] when we are disconnected while autoaway, don't loose previous status. fixes #2934 --- src/common/connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/connection.py b/src/common/connection.py index 874041a35..0f3ea14f6 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -112,7 +112,7 @@ class Connection(ConnectionHandlers): def _reconnect(self): # Do not try to reco while we are already trying self.time_to_reconnect = None - if self.connected < 2: #connection failed + if self.connected < 2: # connection failed log.debug('reconnect') self.connected = 1 self.dispatch('STATUS', 'connecting') @@ -152,6 +152,11 @@ class Connection(ConnectionHandlers): if gajim.config.get_per('accounts', self.name, 'autoreconnect'): self.connected = -1 self.dispatch('STATUS', 'error') + if gajim.status_before_autoaway[self.name]: + # We were auto away. So go back online + self.status = gajim.status_before_autoaway[self.name] + gajim.status_before_autoaway[self.name] = '' + self.old_show = 'online' # this check has moved from _reconnect method # do exponential backoff until 15 minutes, # then small linear increase