summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slixmpp/plugins/xep_0049/private_storage.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/slixmpp/plugins/xep_0049/private_storage.py b/slixmpp/plugins/xep_0049/private_storage.py
index a66c05d1..32309069 100644
--- a/slixmpp/plugins/xep_0049/private_storage.py
+++ b/slixmpp/plugins/xep_0049/private_storage.py
@@ -9,6 +9,7 @@
import logging
from slixmpp import Iq
+from slixmpp import coroutine_wrapper
from slixmpp.plugins import BasePlugin
from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
@@ -32,8 +33,9 @@ class XEP_0049(BasePlugin):
def register(self, stanza):
register_stanza_plugin(PrivateXML, stanza, iterable=True)
+ @coroutine_wrapper
def store(self, data, ifrom=None, timeout=None, callback=None,
- timeout_callback=None):
+ timeout_callback=None, coroutine=False):
iq = self.xmpp.Iq()
iq['type'] = 'set'
iq['from'] = ifrom
@@ -44,14 +46,15 @@ class XEP_0049(BasePlugin):
for elem in data:
iq['private'].append(elem)
- return iq.send(timeout=timeout, callback=callback,
+ return iq.send(timeout=timeout, callback=callback, coroutine=coroutine,
timeout_callback=timeout_callback)
+ @coroutine_wrapper
def retrieve(self, name, ifrom=None, timeout=None, callback=None,
- timeout_callback=None):
+ timeout_callback=None, coroutine=False):
iq = self.xmpp.Iq()
iq['type'] = 'get'
iq['from'] = ifrom
iq['private'].enable(name)
- return iq.send(timeout=timeout, callback=callback,
- timeout_callback=timeout_callback)
+ return iq.send(timeout=timeout, callback=callback, coroutine=coroutine,
+ timeout_callback=timeout_callback)