From efae8f33691516282f3ada20f2a17e35162a51ae Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 30 Dec 2011 20:51:41 -0500 Subject: [PATCH] Automatically use local disco based on the JID. --- sleekxmpp/plugins/xep_0030/disco.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py index 58d5b7f..65c5ecc 100644 --- a/sleekxmpp/plugins/xep_0030/disco.py +++ b/sleekxmpp/plugins/xep_0030/disco.py @@ -318,7 +318,16 @@ class xep_0030(base_plugin): received instead of blocking and waiting for the reply. """ - if local or jid is None: + if jid is not None and not isinstance(jid, JID): + jid = JID(jid) + if self.xmpp.is_component: + if jid.domain == self.xmpp.boundjid.domain: + local = True + else: + if str(jid) == str(self.xmpp.boundjid): + local = True + + if local or jid in (None, ''): log.debug("Looking up local disco#info data " + \ "for %s, node %s.", jid, node) info = self._run_node_handler('get_info',