summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-01-15 10:08:35 -0500
committerLance Stout <lancestout@gmail.com>2011-01-15 10:08:35 -0500
commita2891d760867c00f222ff4323b107378cd7a3a3d (patch)
tree3ac85684ecdbe3df0ed18188615e98696c87a3ce /sleekxmpp
parentd7dea0c6ccdd769fb32229e8b719a7556b8e0643 (diff)
downloadslixmpp-a2891d760867c00f222ff4323b107378cd7a3a3d.tar.gz
slixmpp-a2891d760867c00f222ff4323b107378cd7a3a3d.tar.bz2
slixmpp-a2891d760867c00f222ff4323b107378cd7a3a3d.tar.xz
slixmpp-a2891d760867c00f222ff4323b107378cd7a3a3d.zip
Fix how disco plugin looks up info and items for clients.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/xep_0030/disco.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py
index 6fd4e85f..72dda1db 100644
--- a/sleekxmpp/plugins/xep_0030/disco.py
+++ b/sleekxmpp/plugins/xep_0030/disco.py
@@ -177,7 +177,10 @@ class xep_0030(base_plugin):
elif node is None:
self._handlers[htype]['jid'][jid] = handler
elif jid is None:
- jid = self.xmpp.boundjid.full
+ if self.xmpp.is_component:
+ jid = self.xmpp.boundjid.full
+ else:
+ jid = self.xmpp.boundjid.bare
self._handlers[htype]['node'][(jid, node)] = handler
else:
self._handlers[htype]['node'][(jid, node)] = handler
@@ -500,7 +503,10 @@ class xep_0030(base_plugin):
data -- Optional, custom data to pass to the handler.
"""
if jid is None:
- jid = self.xmpp.boundjid.full
+ if self.xmpp.is_component:
+ jid = self.xmpp.boundjid.full
+ else:
+ jid = self.xmpp.boundjid.bare
if node is None:
node = ''
@@ -526,8 +532,12 @@ class xep_0030(base_plugin):
if iq['type'] == 'get':
log.debug("Received disco info query from " + \
"<%s> to <%s>." % (iq['from'], iq['to']))
+ if self.xmpp.is_component:
+ jid = iq['to'].full
+ else:
+ jid = iq['to'].bare
info = self._run_node_handler('get_info',
- iq['to'].full,
+ jid,
iq['disco_info']['node'],
iq)
iq.reply()
@@ -552,8 +562,12 @@ class xep_0030(base_plugin):
if iq['type'] == 'get':
log.debug("Received disco items query from " + \
"<%s> to <%s>." % (iq['from'], iq['to']))
+ if self.xmpp.is_component:
+ jid = iq['to'].full
+ else:
+ jid = iq['to'].bare
items = self._run_node_handler('get_items',
- iq['to'].full,
+ jid,
iq['disco_items']['node'])
iq.reply()
if items: