From df0198abfee83b2a070a7cc2f1a543837189a4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 1 Jul 2018 01:32:00 +0100 Subject: xep_0030: Add callback parameter to find_identities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/plugins/xep_0030/disco.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slixmpp/plugins/xep_0030/disco.py b/slixmpp/plugins/xep_0030/disco.py index 7a682676..f16d36d2 100644 --- a/slixmpp/plugins/xep_0030/disco.py +++ b/slixmpp/plugins/xep_0030/disco.py @@ -299,7 +299,7 @@ class XEP_0030(BasePlugin): return self.api['has_identity'](jid, node, ifrom, data) async def find_identities(category, type_, domain=None, timeout=None, - cached=True, **kwargs): + cached=True, callback=None, **kwargs): if domain is None: domain = self.xmpp.boundjid.domain @@ -322,6 +322,9 @@ class XEP_0030(BasePlugin): for identity in info['disco_info']['identities']: if identity[0] == category and identity[1] == type_: results.append(info) + + if callback is not None: + callback(results) return results @future_wrapper -- cgit v1.2.3