summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030/disco.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-09-26 01:42:51 -0700
committerLance Stout <lancestout@gmail.com>2012-09-26 01:42:51 -0700
commitb8f04983e1fe3ca45471125f005f41cc290d1bbf (patch)
tree49604f3f1a028adeb6c87c3714310ae59f7c2dc0 /sleekxmpp/plugins/xep_0030/disco.py
parent90807dd97392c6b25cdaaeadf5ff816930b24bd1 (diff)
downloadslixmpp-b8f04983e1fe3ca45471125f005f41cc290d1bbf.tar.gz
slixmpp-b8f04983e1fe3ca45471125f005f41cc290d1bbf.tar.bz2
slixmpp-b8f04983e1fe3ca45471125f005f41cc290d1bbf.tar.xz
slixmpp-b8f04983e1fe3ca45471125f005f41cc290d1bbf.zip
Allow disco queries to got to server when no JID is specified and marked not local.
Diffstat (limited to 'sleekxmpp/plugins/xep_0030/disco.py')
-rw-r--r--sleekxmpp/plugins/xep_0030/disco.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py
index be66b6fd..278b4a34 100644
--- a/sleekxmpp/plugins/xep_0030/disco.py
+++ b/sleekxmpp/plugins/xep_0030/disco.py
@@ -288,7 +288,7 @@ class XEP_0030(BasePlugin):
'cached': cached}
return self.api['has_identity'](jid, node, ifrom, data)
- def get_info(self, jid=None, node=None, local=False,
+ def get_info(self, jid=None, node=None, local=None,
cached=None, **kwargs):
"""
Retrieve the disco#info results from a given JID/node combination.
@@ -325,17 +325,18 @@ class XEP_0030(BasePlugin):
received instead of blocking and waiting for
the reply.
"""
- 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
- jid = jid.full
- elif jid in (None, ''):
- local = True
+ if local 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
+ jid = jid.full
+ elif jid in (None, ''):
+ local = True
if local:
log.debug("Looking up local disco#info data " + \
@@ -405,7 +406,7 @@ class XEP_0030(BasePlugin):
the XEP-0059 plugin, if the plugin is loaded.
Otherwise the parameter is ignored.
"""
- if local or jid is None:
+ if local or local is None and jid is None:
items = self.api['get_items'](jid, node,
kwargs.get('ifrom', None),
kwargs)