From 4d063e287e1bb2010d115325a3c8c6ca7c542bfc Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 12 Feb 2015 12:21:20 +0100 Subject: Remove more threaded= and block= options from the plugins (also, correct a typo) --- slixmpp/plugins/xep_0047/ibb.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'slixmpp/plugins/xep_0047/ibb.py') 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': -- cgit v1.2.3