diff options
author | mathieui <mathieui@mathieui.net> | 2015-02-12 12:21:20 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-02-12 12:21:20 +0100 |
commit | 4d063e287e1bb2010d115325a3c8c6ca7c542bfc (patch) | |
tree | a8893d89d44d92e25a078a1d481152cf319b3b14 /slixmpp/plugins/xep_0313/mam.py | |
parent | 44f02fb3ab286e80d7f82031f751b3650cb94f8b (diff) | |
download | slixmpp-4d063e287e1bb2010d115325a3c8c6ca7c542bfc.tar.gz slixmpp-4d063e287e1bb2010d115325a3c8c6ca7c542bfc.tar.bz2 slixmpp-4d063e287e1bb2010d115325a3c8c6ca7c542bfc.tar.xz slixmpp-4d063e287e1bb2010d115325a3c8c6ca7c542bfc.zip |
Remove more threaded= and block= options from the plugins
(also, correct a typo)
Diffstat (limited to 'slixmpp/plugins/xep_0313/mam.py')
-rw-r--r-- | slixmpp/plugins/xep_0313/mam.py | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/slixmpp/plugins/xep_0313/mam.py b/slixmpp/plugins/xep_0313/mam.py index eafbfcfd..d1c6b983 100644 --- a/slixmpp/plugins/xep_0313/mam.py +++ b/slixmpp/plugins/xep_0313/mam.py @@ -41,7 +41,7 @@ class XEP_0313(BasePlugin): register_stanza_plugin(stanza.MAM, self.xmpp['xep_0059'].stanza.Set) def retrieve(self, jid=None, start=None, end=None, with_jid=None, ifrom=None, - block=True, timeout=None, callback=None, iterator=False): + timeout=None, callback=None, iterator=False): iq = self.xmpp.Iq() query_id = iq['id'] @@ -60,21 +60,12 @@ class XEP_0313(BasePlugin): if iterator: return self.xmpp['xep_0059'].iterate(iq, 'mam', 'results') - elif not block and callback is not None: - def wrapped_cb(iq): - results = collector.stop() - if iq['type'] == 'result': - iq['mam']['results'] = results - callback(iq) - return iq.send(block=block, timeout=timeout, callback=wrapped_cb) - else: - try: - resp = iq.send(block=block, timeout=timeout, callback=callback) - resp['mam']['results'] = collector.stop() - return resp - except XMPPError as e: - collector.stop() - raise e + def wrapped_cb(iq): + results = collector.stop() + if iq['type'] == 'result': + iq['mam']['results'] = results + callback(iq) + return iq.send(timeout=timeout, callback=wrapped_cb) def set_preferences(self, jid=None, default=None, always=None, never=None, ifrom=None, block=True, timeout=None, callback=None): |