diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-01 18:46:33 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-01 18:46:33 +0200 |
commit | 3502480384bd7d9f4e4eb1a3b92e8df08f4e487c (patch) | |
tree | a2e68835f4de6c32808412455f88310c05528191 /slixmpp/plugins/xep_0115 | |
parent | 66909aafb300868ffd3ed9ab02bc3bd28c49a6e9 (diff) | |
download | slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.tar.gz slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.tar.bz2 slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.tar.xz slixmpp-3502480384bd7d9f4e4eb1a3b92e8df08f4e487c.zip |
Switch from @asyncio.coroutine to async def everywhere.
Diffstat (limited to 'slixmpp/plugins/xep_0115')
-rw-r--r-- | slixmpp/plugins/xep_0115/caps.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/slixmpp/plugins/xep_0115/caps.py b/slixmpp/plugins/xep_0115/caps.py index 9b2d499e..749b74bd 100644 --- a/slixmpp/plugins/xep_0115/caps.py +++ b/slixmpp/plugins/xep_0115/caps.py @@ -137,8 +137,7 @@ class XEP_0115(BasePlugin): self.xmpp.event('entity_caps', p) - @asyncio.coroutine - def _process_caps(self, pres): + async def _process_caps(self, pres): if not pres['caps']['hash']: log.debug("Received unsupported legacy caps: %s, %s, %s", pres['caps']['node'], @@ -169,7 +168,7 @@ class XEP_0115(BasePlugin): log.debug("New caps verification string: %s", ver) try: node = '%s#%s' % (pres['caps']['node'], ver) - caps = yield from self.xmpp['xep_0030'].get_info(pres['from'], node, + caps = await self.xmpp['xep_0030'].get_info(pres['from'], node, coroutine=True) if isinstance(caps, Iq): @@ -285,10 +284,9 @@ class XEP_0115(BasePlugin): binary = hash(S.encode('utf8')).digest() return base64.b64encode(binary).decode('utf-8') - @asyncio.coroutine - def update_caps(self, jid=None, node=None, preserve=False): + async def update_caps(self, jid=None, node=None, preserve=False): try: - info = yield from self.xmpp['xep_0030'].get_info(jid, node, local=True) + info = await self.xmpp['xep_0030'].get_info(jid, node, local=True) if isinstance(info, Iq): info = info['disco_info'] ver = self.generate_verstring(info, self.hash) |