changeset 2694:a8ec00731ce7

core: removed whitespace ping (not needed anymore as we handle XMPP ping)
author Goffi <goffi@goffi.org>
date Mon, 19 Nov 2018 21:08:25 +0100
parents f64f1158a26e
children c5543fba97e8
files sat/core/constants.py sat/core/xmpp.py
diffstat 2 files changed, 1 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/constants.py	Sun Nov 18 15:49:59 2018 +0100
+++ b/sat/core/constants.py	Mon Nov 19 21:08:25 2018 +0100
@@ -49,7 +49,6 @@
 
     ## Protocol ##
     XMPP_C2S_PORT = 5222
-    XMPP_KEEP_ALIFE = 180
     XMPP_MAX_RETRIES = None
     # default port used on Prosody, may differ on other servers
     XMPP_COMPONENT_PORT = 5347
--- a/sat/core/xmpp.py	Sun Nov 18 15:49:59 2018 +0100
+++ b/sat/core/xmpp.py	Mon Nov 19 21:08:25 2018 +0100
@@ -20,7 +20,7 @@
 from sat.core.i18n import _
 from sat.core.constants import Const as C
 from sat.memory import cache
-from twisted.internet import task, defer
+from twisted.internet import defer
 from twisted.words.protocols.jabber.xmlstream import XMPPHandler
 from twisted.words.protocols.jabber import xmlstream
 from twisted.words.protocols.jabber import error
@@ -241,10 +241,6 @@
         )  # we send the signal to the clients
 
 
-        self.keep_alife = task.LoopingCall(
-            self.xmlstream.send, " "
-        )  # Needed to avoid disconnection (specially with openfire)
-        self.keep_alife.start(C.XMPP_KEEP_ALIFE)
         self.disco = SatDiscoProtocol(self)
         self.disco.setHandlerParent(self)
         self.discoHandler = disco.DiscoHandler()
@@ -284,10 +280,6 @@
         super(SatXMPPEntity, self)._connected(xs)
 
     def disconnectProfile(self, reason):
-        try:
-            self.keep_alife.stop()
-        except AttributeError:
-            log.debug(_("No keep_alife"))
         if self._connected_d is not None:
             self.host_app.bridge.disconnected(
                 self.profile