diff options
author | mathieui <mathieui@mathieui.net> | 2021-02-14 12:06:05 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-02-26 00:08:56 +0100 |
commit | 13de36baa1ad0b57fd674f514203d3ea34ee5c7d (patch) | |
tree | 0476e25377da6af9d73c0882115a21203559634d /slixmpp/plugins/xep_0030/static.py | |
parent | 7772e26a8c766c2606b40f4260e406cd3ed56435 (diff) | |
download | slixmpp-13de36baa1ad0b57fd674f514203d3ea34ee5c7d.tar.gz slixmpp-13de36baa1ad0b57fd674f514203d3ea34ee5c7d.tar.bz2 slixmpp-13de36baa1ad0b57fd674f514203d3ea34ee5c7d.tar.xz slixmpp-13de36baa1ad0b57fd674f514203d3ea34ee5c7d.zip |
XEP-0030: API changes
- ``supports``, ``has_identity``, ``get_info``, ``get_items`` are now coroutines
- ``set_info````set_items``, ``del_items``, ``add_item``, ``add_identity``,
``del_identity``, ``set_identities``, ``del_identities``, ``add_feature``,
``del_feature``, ``set_feature``, ``set_features``, ``del_features``
now return a Future
also fix has_identity and supports which have been broken in forever
Diffstat (limited to 'slixmpp/plugins/xep_0030/static.py')
-rw-r--r-- | slixmpp/plugins/xep_0030/static.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/slixmpp/plugins/xep_0030/static.py b/slixmpp/plugins/xep_0030/static.py index 1b5ff2d8..1ae34148 100644 --- a/slixmpp/plugins/xep_0030/static.py +++ b/slixmpp/plugins/xep_0030/static.py @@ -109,7 +109,7 @@ class StaticDisco(object): # the requester's JID, except for cached results. To do that, # register a custom node handler. - def supports(self, jid, node, ifrom, data): + async def supports(self, jid, node, ifrom, data): """ Check if a JID supports a given feature. @@ -137,8 +137,8 @@ class StaticDisco(object): return False try: - info = self.disco.get_info(jid=jid, node=node, - ifrom=ifrom, **data) + info = await self.disco.get_info(jid=jid, node=node, + ifrom=ifrom, **data) info = self.disco._wrap(ifrom, jid, info, True) features = info['disco_info']['features'] return feature in features @@ -147,7 +147,7 @@ class StaticDisco(object): except IqTimeout: return None - def has_identity(self, jid, node, ifrom, data): + async def has_identity(self, jid, node, ifrom, data): """ Check if a JID has a given identity. @@ -176,8 +176,8 @@ class StaticDisco(object): 'cached': data.get('cached', True)} try: - info = self.disco.get_info(jid=jid, node=node, - ifrom=ifrom, **data) + info = await self.disco.get_info(jid=jid, node=node, + ifrom=ifrom, **data) info = self.disco._wrap(ifrom, jid, info, True) trunc = lambda i: (i[0], i[1], i[2]) return identity in map(trunc, info['disco_info']['identities']) |