diff options
author | mathieui <mathieui@mathieui.net> | 2015-02-23 19:33:52 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-02-24 22:46:06 +0100 |
commit | f795ac02e322445be13077463638924d1f22d313 (patch) | |
tree | 57c3e44fd04f1da4954cff0bf2c69fd4b4979914 | |
parent | 6e8235544cc1bdefea75a8d93e5e3a48a13552ba (diff) | |
download | slixmpp-f795ac02e322445be13077463638924d1f22d313.tar.gz slixmpp-f795ac02e322445be13077463638924d1f22d313.tar.bz2 slixmpp-f795ac02e322445be13077463638924d1f22d313.tar.xz slixmpp-f795ac02e322445be13077463638924d1f22d313.zip |
XEP-0280: wrap functions with coroutine_wrapper
-rw-r--r-- | slixmpp/plugins/xep_0280/carbons.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/slixmpp/plugins/xep_0280/carbons.py b/slixmpp/plugins/xep_0280/carbons.py index a64ccbfd..4548a31e 100644 --- a/slixmpp/plugins/xep_0280/carbons.py +++ b/slixmpp/plugins/xep_0280/carbons.py @@ -9,6 +9,7 @@ import logging import slixmpp +from slixmpp import coroutine_wrapper from slixmpp.stanza import Message, Iq from slixmpp.xmlstream.handler import Callback from slixmpp.xmlstream.matcher import StanzaPath @@ -66,20 +67,22 @@ class XEP_0280(BasePlugin): def _handle_carbon_sent(self, msg): self.xmpp.event('carbon_sent', msg) + @coroutine_wrapper def enable(self, ifrom=None, timeout=None, callback=None, - timeout_callback=None): + timeout_callback=None, coroutine=False): iq = self.xmpp.Iq() iq['type'] = 'set' iq['from'] = ifrom iq.enable('carbon_enable') return iq.send(timeout_callback=timeout_callback, timeout=timeout, - callback=callback) + callback=callback, coroutine=coroutine) + @coroutine_wrapper def disable(self, ifrom=None, timeout=None, callback=None, - timeout_callback=None): + timeout_callback=None, coroutine=False): iq = self.xmpp.Iq() iq['type'] = 'set' iq['from'] = ifrom iq.enable('carbon_disable') return iq.send(timeout_callback=timeout_callback, timeout=timeout, - callback=callback) + callback=callback, coroutine=coroutine) |