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_0047/ibb.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_0047/ibb.py')
-rw-r--r-- | slixmpp/plugins/xep_0047/ibb.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/slixmpp/plugins/xep_0047/ibb.py b/slixmpp/plugins/xep_0047/ibb.py index 7c01c78a..87cd1f51 100644 --- a/slixmpp/plugins/xep_0047/ibb.py +++ b/slixmpp/plugins/xep_0047/ibb.py @@ -116,7 +116,7 @@ class XEP_0047(BasePlugin): self._preauthed_sids[(jid, sid, ifrom)] = True def open_stream(self, jid, block_size=None, sid=None, window=1, use_messages=False, - ifrom=None, block=True, timeout=None, callback=None): + ifrom=None, timeout=None, callback=None): if sid is None: sid = str(uuid.uuid4()) if block_size is None: @@ -139,20 +139,15 @@ class XEP_0047(BasePlugin): self._pending_streams[iq['id']] = stream - if block: - resp = iq.send(timeout=timeout) - self._handle_opened_stream(resp) - return stream + cb = None + if callback is not None: + def chained(resp): + self._handle_opened_stream(resp) + callback(resp) + cb = chained else: - cb = None - if callback is not None: - def chained(resp): - self._handle_opened_stream(resp) - callback(resp) - cb = chained - else: - cb = self._handle_opened_stream - return iq.send(block=block, timeout=timeout, callback=cb) + cb = self._handle_opened_stream + return iq.send(timeout=timeout, callback=cb) def _handle_opened_stream(self, iq): if iq['type'] == 'result': |