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_0016/privacy.py | 55 ++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 19 deletions(-) (limited to 'slixmpp/plugins/xep_0016/privacy.py') diff --git a/slixmpp/plugins/xep_0016/privacy.py b/slixmpp/plugins/xep_0016/privacy.py index 25d55048..e07ac633 100644 --- a/slixmpp/plugins/xep_0016/privacy.py +++ b/slixmpp/plugins/xep_0016/privacy.py @@ -29,55 +29,70 @@ class XEP_0016(BasePlugin): def session_bind(self, jid): self.xmpp['xep_0030'].add_feature(Privacy.namespace) - def get_privacy_lists(self, block=True, timeout=None, callback=None): + def get_privacy_lists(self, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'get' iq.enable('privacy') - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def get_list(self, name, block=True, timeout=None, callback=None): + def get_list(self, name, timeout=None, callback=None, timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'get' iq['privacy']['list']['name'] = name - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def get_active(self, block=True, timeout=None, callback=None): + def get_active(self, timeout=None, callback=None, timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'get' iq['privacy'].enable('active') - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def get_default(self, block=True, timeout=None, callback=None): + def get_default(self, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'get' iq['privacy'].enable('default') - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def activate(self, name, block=True, timeout=None, callback=None): + def activate(self, name, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'set' iq['privacy']['active']['name'] = name - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def deactivate(self, block=True, timeout=None, callback=None): + def deactivate(self, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'set' iq['privacy'].enable('active') - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def make_default(self, name, block=True, timeout=None, callback=None): + def make_default(self, name, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'set' iq['privacy']['default']['name'] = name - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def remove_default(self, block=True, timeout=None, callback=None): + def remove_default(self, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'set' iq['privacy'].enable('default') - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) - def edit_list(self, name, rules, block=True, timeout=None, callback=None): + def edit_list(self, name, rules, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'set' iq['privacy']['list']['name'] = name @@ -103,8 +118,10 @@ class XEP_0016(BasePlugin): presence_out=rule.get('presence_out', rule.get('presence-out', None))) - def remove_list(self, name, block=True, timeout=None, callback=None): + def remove_list(self, name, timeout=None, callback=None, + timeout_callback=None): iq = self.xmpp.Iq() iq['type'] = 'set' iq['privacy']['list']['name'] = name - return iq.send(block=block, timeout=timeout, callback=callback) + iq.send(timeout=timeout, callback=callback, + timeout_callback=timeout_callback) -- cgit v1.2.3