xep_0030: Add callback parameter to find_identities
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
c20f4bf5fa
commit
df0198abfe
@ -299,7 +299,7 @@ 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,
|
||||||
cached=True, **kwargs):
|
cached=True, callback=None, **kwargs):
|
||||||
if domain is None:
|
if domain is None:
|
||||||
domain = self.xmpp.boundjid.domain
|
domain = self.xmpp.boundjid.domain
|
||||||
|
|
||||||
@ -322,6 +322,9 @@ class XEP_0030(BasePlugin):
|
|||||||
for identity in info['disco_info']['identities']:
|
for identity in info['disco_info']['identities']:
|
||||||
if identity[0] == category and identity[1] == type_:
|
if identity[0] == category and identity[1] == type_:
|
||||||
results.append(info)
|
results.append(info)
|
||||||
|
|
||||||
|
if callback is not None:
|
||||||
|
callback(results)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
@future_wrapper
|
@future_wrapper
|
||||||
|
Loading…
x
Reference in New Issue
Block a user