Merge branch 'fix-xep_0115-static' into 'master'

XEP-0115: Make get_caps() async

See merge request poezio/slixmpp!203
This commit is contained in:
Maxime Buquet 2022-07-16 19:02:06 +02:00
commit 1f47acaec1

View file

@ -60,7 +60,7 @@ class StaticCaps(object):
return False return False
if node in (None, ''): if node in (None, ''):
info = self.caps.get_caps(jid) info = await self.caps.get_caps(jid)
if info and feature in info['features']: if info and feature in info['features']:
return True return True
@ -134,7 +134,7 @@ class StaticCaps(object):
def get_verstring(self, jid, node, ifrom, data): def get_verstring(self, jid, node, ifrom, data):
return self.jid_vers.get(jid, None) return self.jid_vers.get(jid, None)
def get_caps(self, jid, node, ifrom, data): async def get_caps(self, jid, node, ifrom, data):
verstring = data.get('verstring', None) verstring = data.get('verstring', None)
if verstring is None: if verstring is None:
return None return None