Compare commits

..

3 commits

Author SHA1 Message Date
5c19f16287
xep_0030: asyncio.wait takes tasks
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-02-15 11:55:57 +01:00
af07864cbb Merge branch 'fix-caps-fetch' into 'master'
XEP-0115: fix a missing await in caps fetching

See merge request poezio/slixmpp!227
2023-01-30 19:46:53 +00:00
mathieui
dc4b1c7367 XEP-0115: fix a missing await in caps fetching 2023-01-30 20:37:16 +01:00
2 changed files with 4 additions and 4 deletions

View file

@ -315,13 +315,13 @@ class XEP_0030(BasePlugin):
domain = self.xmpp.boundjid.domain
if not cached or domain not in self.domain_infos:
infos = [self.get_info(
domain, timeout=timeout, **iqkwargs)]
infos = [asyncio.create_task(self.get_info(
domain, timeout=timeout, **iqkwargs))]
iq_items = await self.get_items(
domain, timeout=timeout, **iqkwargs)
items = iq_items['disco_items']['items']
infos += [
self.get_info(item[0], timeout=timeout, **iqkwargs)
asyncio.create_task(self.get_info(item[0], timeout=timeout, **iqkwargs))
for item in items]
info_futures, _ = await asyncio.wait(
infos,

View file

@ -162,7 +162,7 @@ class XEP_0115(BasePlugin):
if pres['caps']['hash'] not in self.hashes:
try:
log.debug("Unknown caps hash: %s", pres['caps']['hash'])
self.xmpp['xep_0030'].get_info(jid=pres['from'], ifrom=ifrom)
await self.xmpp['xep_0030'].get_info(jid=pres['from'], ifrom=ifrom)
return
except XMPPError:
return