XEP-0163: wrap publish() with coroutine_wrapper

This commit is contained in:
mathieui 2015-02-23 19:12:12 +01:00
parent e85fa4203e
commit 69da1c1d7c
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -10,6 +10,7 @@ import logging
from slixmpp.xmlstream import register_stanza_plugin
from slixmpp.plugins.base import BasePlugin, register_plugin
from slixmpp import coroutine_wrapper
log = logging.getLogger(__name__)
@ -82,8 +83,9 @@ class XEP_0163(BasePlugin):
feature='%s+notify' % namespace)
self.xmpp['xep_0115'].update_caps(jid)
@coroutine_wrapper
def publish(self, stanza, node=None, id=None, options=None, ifrom=None,
timeout_callback=None, callback=None, timeout=None):
timeout_callback=None, callback=None, timeout=None, coroutine=False):
"""
Publish a PEP update.
@ -113,7 +115,8 @@ class XEP_0163(BasePlugin):
options=options, ifrom=ifrom,
callback=callback,
timeout=timeout,
timeout_callback=timeout_callback)
timeout_callback=timeout_callback,
coroutine=coroutine)
register_plugin(XEP_0163)