summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0199/ping.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2011-09-01 15:51:43 -0700
committerNathan Fritz <fritzy@netflint.net>2011-09-01 15:51:43 -0700
commit20cacc84badca3d11e572e221b759797f6ade51b (patch)
tree33344a2def10dc8fe45baa4b0483a920133e304d /sleekxmpp/plugins/xep_0199/ping.py
parent24a14a02843354946024eb8f11c41c69350851af (diff)
downloadslixmpp-20cacc84badca3d11e572e221b759797f6ade51b.tar.gz
slixmpp-20cacc84badca3d11e572e221b759797f6ade51b.tar.bz2
slixmpp-20cacc84badca3d11e572e221b759797f6ade51b.tar.xz
slixmpp-20cacc84badca3d11e572e221b759797f6ade51b.zip
remove ping schedule on disconnect
Diffstat (limited to 'sleekxmpp/plugins/xep_0199/ping.py')
-rw-r--r--sleekxmpp/plugins/xep_0199/ping.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0199/ping.py b/sleekxmpp/plugins/xep_0199/ping.py
index 1baf6f4d..de7f5688 100644
--- a/sleekxmpp/plugins/xep_0199/ping.py
+++ b/sleekxmpp/plugins/xep_0199/ping.py
@@ -70,6 +70,8 @@ class xep_0199(base_plugin):
self.xmpp.add_event_handler('session_start',
self._handle_keepalive,
threaded=True)
+ self.xmpp.add_event_handler('session_end',
+ self._handle_session_end)
def post_init(self):
"""Handle cross-plugin dependencies."""
@@ -106,6 +108,9 @@ class xep_0199(base_plugin):
scheduled_ping,
repeat=True)
+ def _handle_session_end(self, event):
+ self.xmpp.scheduler.remove('Ping Keep Alive')
+
def _handle_ping(self, iq):
"""
Automatically reply to ping requests.