From ab03ad54aaca1725b943abf16585fa4ef6f08897 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 30 Jul 2014 17:52:59 +0200 Subject: Fix the iq.send() function, and a bunch of places where it is called This is a big-and-dirty commit with a bunch of cleanup, maybe breaking a few things, and not fixing all iq.send() calls yet. --- slixmpp/plugins/xep_0199/ping.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'slixmpp/plugins/xep_0199') diff --git a/slixmpp/plugins/xep_0199/ping.py b/slixmpp/plugins/xep_0199/ping.py index 5fdf79b5..a8171105 100644 --- a/slixmpp/plugins/xep_0199/ping.py +++ b/slixmpp/plugins/xep_0199/ping.py @@ -101,7 +101,7 @@ class XEP_0199(BasePlugin): repeat=True) def disable_keepalive(self, event=None): - self.xmpp.scheduler.remove('Ping keepalive') + self.xmpp.cancel_schedule('Ping keepalive') def _keepalive(self, event=None): log.debug("Keepalive ping...") @@ -119,15 +119,13 @@ class XEP_0199(BasePlugin): log.debug("Pinged by %s", iq['from']) iq.reply().send() - def send_ping(self, jid, ifrom=None, block=True, timeout=None, callback=None): + def send_ping(self, jid, ifrom=None, timeout=None, callback=None, + timeout_callback=None): """Send a ping request. Arguments: jid -- The JID that will receive the ping. ifrom -- Specifiy the sender JID. - block -- Indicate if execution should block until - a pong response is received. Defaults - to True. timeout -- Time in seconds to wait for a response. Defaults to self.timeout. callback -- Optional handler to execute when a pong @@ -143,7 +141,8 @@ class XEP_0199(BasePlugin): iq['from'] = ifrom iq.enable('ping') - return iq.send(block=block, timeout=timeout, callback=callback) + return iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) def ping(self, jid=None, ifrom=None, timeout=None): """Send a ping request and calculate RTT. -- cgit v1.2.3