diff options
author | mathieui <mathieui@mathieui.net> | 2015-02-23 19:49:33 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-02-24 22:46:08 +0100 |
commit | e112e864756f1222a044ee28e3c13c5925618b0c (patch) | |
tree | 5de06ae9fdcfb2b697fd0f51a154f194810ea256 | |
parent | e034b31d6bc34f43578456e9c6527bc56dff78e3 (diff) | |
download | slixmpp-e112e864756f1222a044ee28e3c13c5925618b0c.tar.gz slixmpp-e112e864756f1222a044ee28e3c13c5925618b0c.tar.bz2 slixmpp-e112e864756f1222a044ee28e3c13c5925618b0c.tar.xz slixmpp-e112e864756f1222a044ee28e3c13c5925618b0c.zip |
XEP-0279: wrap check_ip() with coroutine_wrapper
-rw-r--r-- | slixmpp/plugins/xep_0279/ipcheck.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0279/ipcheck.py b/slixmpp/plugins/xep_0279/ipcheck.py index b0c0a6ca..fb748f2d 100644 --- a/slixmpp/plugins/xep_0279/ipcheck.py +++ b/slixmpp/plugins/xep_0279/ipcheck.py @@ -10,6 +10,7 @@ import logging from slixmpp import Iq +from slixmpp import coroutine_wrapper from slixmpp.plugins import BasePlugin from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.xep_0279 import stanza, IPCheck @@ -31,9 +32,10 @@ class XEP_0279(BasePlugin): def plugin_end(self): self.xmpp['xep_0030'].del_feature(feature='urn:xmpp:sic:0') - def check_ip(self, ifrom=None, block=True, timeout=None, callback=None): + @coroutine_wrapper + def check_ip(self, ifrom=None, timeout=None, callback=None, coroutine=False): iq = self.xmpp.Iq() iq['type'] = 'get' iq['from'] = ifrom iq.enable('ip_check') - return iq.send(block=block, timeout=timeout, callback=callback) + return iq.send(timeout=timeout, callback=callback, coroutine=coroutine) |