summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030/disco.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-12-30 20:51:41 -0500
committerLance Stout <lancestout@gmail.com>2011-12-30 20:51:41 -0500
commitefae8f33691516282f3ada20f2a17e35162a51ae (patch)
tree32fcc6bd3a64bcfd1afb10d1c034fe0186988f08 /sleekxmpp/plugins/xep_0030/disco.py
parenta11e6c0b773169dd395f7456bba5b1b8dd5971f4 (diff)
downloadslixmpp-efae8f33691516282f3ada20f2a17e35162a51ae.tar.gz
slixmpp-efae8f33691516282f3ada20f2a17e35162a51ae.tar.bz2
slixmpp-efae8f33691516282f3ada20f2a17e35162a51ae.tar.xz
slixmpp-efae8f33691516282f3ada20f2a17e35162a51ae.zip
Automatically use local disco based on the JID.
Diffstat (limited to 'sleekxmpp/plugins/xep_0030/disco.py')
-rw-r--r--sleekxmpp/plugins/xep_0030/disco.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py
index 58d5b7f3..65c5ecc3 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',