From b8f04983e1fe3ca45471125f005f41cc290d1bbf Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 26 Sep 2012 01:42:51 -0700 Subject: Allow disco queries to got to server when no JID is specified and marked not local. --- sleekxmpp/plugins/xep_0030/disco.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'sleekxmpp/plugins/xep_0030') 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) -- cgit v1.2.3