summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-02-23 19:35:01 +0100
committermathieui <mathieui@mathieui.net>2015-02-24 22:46:06 +0100
commit2ee05d9616d2959d19a7a87d21c58e6aae1db56e (patch)
tree923990d02c4c1d06e550623f041a060acc079ed3
parentf795ac02e322445be13077463638924d1f22d313 (diff)
downloadslixmpp-2ee05d9616d2959d19a7a87d21c58e6aae1db56e.tar.gz
slixmpp-2ee05d9616d2959d19a7a87d21c58e6aae1db56e.tar.bz2
slixmpp-2ee05d9616d2959d19a7a87d21c58e6aae1db56e.tar.xz
slixmpp-2ee05d9616d2959d19a7a87d21c58e6aae1db56e.zip
XEP-0012: wrap get_last_activity() with coroutine_wrapper
-rw-r--r--slixmpp/plugins/xep_0012/last_activity.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0012/last_activity.py b/slixmpp/plugins/xep_0012/last_activity.py
index c1f69a44..078c5411 100644
--- a/slixmpp/plugins/xep_0012/last_activity.py
+++ b/slixmpp/plugins/xep_0012/last_activity.py
@@ -16,6 +16,7 @@ from slixmpp.xmlstream import JID, register_stanza_plugin
from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
from slixmpp.plugins.xep_0012 import stanza, LastActivity
+from slixmpp import coroutine_wrapper
log = logging.getLogger(__name__)
@@ -76,8 +77,9 @@ class XEP_0012(BasePlugin):
def del_last_activity(self, jid):
self.api['del_last_activity'](jid)
+ @coroutine_wrapper
def get_last_activity(self, jid, local=False, ifrom=None, timeout=None,
- callback=None, timeout_callback=None):
+ callback=None, timeout_callback=None, coroutine=False):
if jid is not None and not isinstance(jid, JID):
jid = JID(jid)
@@ -98,7 +100,7 @@ class XEP_0012(BasePlugin):
iq['to'] = jid
iq['type'] = 'get'
iq.enable('last_activity')
- return iq.send(timeout=timeout, callback=callback,
+ return iq.send(timeout=timeout, callback=callback, coroutine=coroutine,
timeout_callback=timeout_callback)
def _handle_get_last_activity(self, iq):