XEP-0092: wrap get_version() with coroutine_wrapper
This commit is contained in:
parent
4da870fd19
commit
6e35948276
1 changed files with 5 additions and 2 deletions
|
@ -15,6 +15,7 @@ from slixmpp.xmlstream.handler import Callback
|
||||||
from slixmpp.xmlstream.matcher import StanzaPath
|
from slixmpp.xmlstream.matcher import StanzaPath
|
||||||
from slixmpp.plugins import BasePlugin
|
from slixmpp.plugins import BasePlugin
|
||||||
from slixmpp.plugins.xep_0092 import Version, stanza
|
from slixmpp.plugins.xep_0092 import Version, stanza
|
||||||
|
from slixmpp import coroutine_wrapper
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -70,7 +71,9 @@ class XEP_0092(BasePlugin):
|
||||||
iq['software_version']['os'] = self.os
|
iq['software_version']['os'] = self.os
|
||||||
iq.send()
|
iq.send()
|
||||||
|
|
||||||
def get_version(self, jid, ifrom=None, timeout=None, callback=None):
|
@coroutine_wrapper
|
||||||
|
def get_version(self, jid, ifrom=None, timeout=None, callback=None,
|
||||||
|
coroutine=False):
|
||||||
"""
|
"""
|
||||||
Retrieve the software version of a remote agent.
|
Retrieve the software version of a remote agent.
|
||||||
|
|
||||||
|
@ -82,4 +85,4 @@ class XEP_0092(BasePlugin):
|
||||||
iq['from'] = ifrom
|
iq['from'] = ifrom
|
||||||
iq['type'] = 'get'
|
iq['type'] = 'get'
|
||||||
iq['query'] = Version.namespace
|
iq['query'] = Version.namespace
|
||||||
return iq.send(timeout=timeout, callback=callback)
|
return iq.send(timeout=timeout, callback=callback, coroutine=coroutine)
|
||||||
|
|
Loading…
Reference in a new issue