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_0196/user_gaming.py | 34 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'slixmpp/plugins/xep_0196/user_gaming.py') diff --git a/slixmpp/plugins/xep_0196/user_gaming.py b/slixmpp/plugins/xep_0196/user_gaming.py index cf940ce9..f0dee99f 100644 --- a/slixmpp/plugins/xep_0196/user_gaming.py +++ b/slixmpp/plugins/xep_0196/user_gaming.py @@ -33,9 +33,11 @@ class XEP_0196(BasePlugin): def session_bind(self, jid): self.xmpp['xep_0163'].register_pep('user_gaming', UserGaming) - def publish_gaming(self, name=None, level=None, server_name=None, uri=None, - character_name=None, character_profile=None, server_address=None, - options=None, ifrom=None, block=True, callback=None, timeout=None): + def publish_gaming(self, name=None, level=None, server_name=None, + uri=None, character_name=None, + character_profile=None, server_address=None, + options=None, ifrom=None, callback=None, + timeout=None, timeout_callback=None): """ Publish the user's current gaming status. @@ -50,8 +52,6 @@ class XEP_0196(BasePlugin): character_profile -- A URI for a profile of the user's character. options -- Optional form of publish options. ifrom -- Specify the sender's JID. - block -- Specify if the send call will block until a response - is received, or a timeout occurs. Defaults to True. timeout -- The length of time (in seconds) to wait for a response before exiting the send call if blocking is used. Defaults to slixmpp.xmlstream.RESPONSE_TIMEOUT @@ -67,21 +67,18 @@ class XEP_0196(BasePlugin): gaming['server_name'] = server_name gaming['server_address'] = server_address return self.xmpp['xep_0163'].publish(gaming, - node=UserGaming.namespace, - options=options, - ifrom=ifrom, - block=block, - callback=callback, - timeout=timeout) + node=UserGaming.namespace, + options=options, ifrom=ifrom, + callback=callback, timeout=timeout, + timeout_callback=timeout_callback) - def stop(self, ifrom=None, block=True, callback=None, timeout=None): + def stop(self, ifrom=None, callback=None, timeout=None, + timeout_callback=None): """ Clear existing user gaming information to stop notifications. Arguments: ifrom -- Specify the sender's JID. - block -- Specify if the send call will block until a response - is received, or a timeout occurs. Defaults to True. timeout -- The length of time (in seconds) to wait for a response before exiting the send call if blocking is used. Defaults to slixmpp.xmlstream.RESPONSE_TIMEOUT @@ -90,8 +87,7 @@ class XEP_0196(BasePlugin): """ gaming = UserGaming() return self.xmpp['xep_0163'].publish(gaming, - node=UserGaming.namespace, - ifrom=ifrom, - block=block, - callback=callback, - timeout=timeout) + node=UserGaming.namespace, + ifrom=ifrom, callback=callback, + timeout=timeout, + timeout_callback=timeout_callback) -- cgit v1.2.3