xep_0030: Add cached parameter to find_identities, defaults to True

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2018-06-30 23:05:25 +01:00
parent 9740e93aeb
commit c20f4bf5fa

View file

@ -299,11 +299,11 @@ class XEP_0030(BasePlugin):
return self.api['has_identity'](jid, node, ifrom, data) return self.api['has_identity'](jid, node, ifrom, data)
async def find_identities(category, type_, domain=None, timeout=None, async def find_identities(category, type_, domain=None, timeout=None,
**kwargs): cached=True, **kwargs):
if domain is None: if domain is None:
domain = self.xmpp.boundjid.domain domain = self.xmpp.boundjid.domain
if domain not in self.domain_infos: if not cached or domain not in self.domain_infos:
infos = [self.get_info( infos = [self.get_info(
domain, timeout=timeout, **kwargs)] domain, timeout=timeout, **kwargs)]
iq_items = await self.get_items( iq_items = await self.get_items(