summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-02-23 19:41:40 +0100
committermathieui <mathieui@mathieui.net>2015-02-24 22:46:07 +0100
commit17464b10a42d9b3c4daba763e06e53c429478abd (patch)
treea6c4a1b5ff24f6fbb6ce6668e86b26e5333fc2f3
parent6fb3ecd414f24374f17811d7ad2fd01e4924e311 (diff)
downloadslixmpp-17464b10a42d9b3c4daba763e06e53c429478abd.tar.gz
slixmpp-17464b10a42d9b3c4daba763e06e53c429478abd.tar.bz2
slixmpp-17464b10a42d9b3c4daba763e06e53c429478abd.tar.xz
slixmpp-17464b10a42d9b3c4daba763e06e53c429478abd.zip
XEP-0231: wrap get_bob() with coroutine_wrapper
-rw-r--r--slixmpp/plugins/xep_0231/bob.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0231/bob.py b/slixmpp/plugins/xep_0231/bob.py
index 0fb01ca5..69e89373 100644
--- a/slixmpp/plugins/xep_0231/bob.py
+++ b/slixmpp/plugins/xep_0231/bob.py
@@ -10,6 +10,7 @@
import logging
import hashlib
+from slixmpp import coroutine_wrapper
from slixmpp.stanza import Iq, Message, Presence
from slixmpp.exceptions import XMPPError
from slixmpp.xmlstream.handler import Callback
@@ -81,8 +82,9 @@ class XEP_0231(BasePlugin):
return cid
+ @coroutine_wrapper
def get_bob(self, jid=None, cid=None, cached=True, ifrom=None,
- timeout=None, callback=None):
+ timeout=None, callback=None, coroutine=False):
if cached:
data = self.api['get_bob'](None, None, ifrom, args=cid)
if data is not None:
@@ -97,7 +99,7 @@ class XEP_0231(BasePlugin):
iq['from'] = ifrom
iq['type'] = 'get'
iq['bob']['cid'] = cid
- return iq.send(timeout=timeout, callback=callback)
+ return iq.send(timeout=timeout, callback=callback, coroutine=coroutine)
def del_bob(self, cid):
self.api['del_bob'](args=cid)