[Git][gajim/gajim][master] Remove ping timeout on disconnect handler

Philipp Hörist gitlab at dev.gajim.org
Fri Jan 4 00:50:10 CET 2019


Philipp Hörist pushed to branch master at gajim / gajim


Commits:
5fd1e7b4 by Philipp Hörist at 2019-01-03T23:49:59Z
Remove ping timeout on disconnect handler

- - - - -


2 changed files:

- gajim/common/connection.py
- gajim/common/modules/ping.py


Changes:

=====================================
gajim/common/connection.py
=====================================
@@ -675,6 +675,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 
     def _disconnect(self):
         log.info('Set state disconnected')
+        self.get_module('Ping').remove_timeout()
         self.connected = 0
         self.disable_reconnect_timer()
 


=====================================
gajim/common/modules/ping.py
=====================================
@@ -66,10 +66,8 @@ class Ping:
         self.remove_timeout()
 
     def _reconnect(self) -> None:
-        if not app.config.get_per('accounts', self._account, 'active'):
-            # Account may have been disabled
+        if not app.account_is_connected(self._account):
             return
-
         # We haven't got the pong in time, disco and reconnect
         log.warning('No reply received for keepalive ping. Reconnecting...')
         self._con.disconnect(immediately=True)



View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5fd1e7b4bfb61e6f983dfaa25a4de6b639ffa58b

-- 
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5fd1e7b4bfb61e6f983dfaa25a4de6b639ffa58b
You're receiving this email because of your account on dev.gajim.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gajim.org/pipermail/commits/attachments/20190104/003675f2/attachment-0001.html>


More information about the Commits mailing list