summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-09 22:22:05 -0700
committerLance Stout <lancestout@gmail.com>2012-07-09 22:22:05 -0700
commit1baae1b81ef0765c0f069e67911d7c5224bb4800 (patch)
tree3cda0c55cba81bce3390323e3323dc740030f7bc /sleekxmpp/plugins/xep_0030
parent7d20f0e9a6cbb9d45b167aca8563d45baf2a112a (diff)
downloadslixmpp-1baae1b81ef0765c0f069e67911d7c5224bb4800.tar.gz
slixmpp-1baae1b81ef0765c0f069e67911d7c5224bb4800.tar.bz2
slixmpp-1baae1b81ef0765c0f069e67911d7c5224bb4800.tar.xz
slixmpp-1baae1b81ef0765c0f069e67911d7c5224bb4800.zip
Fix issues of disco info leaking between entities with the same bare JIDs.
To ensure that disco info, or any settings which depend on the bound JID, are correct, only set such information on or after the session_bound event has fired.
Diffstat (limited to 'sleekxmpp/plugins/xep_0030')
-rw-r--r--sleekxmpp/plugins/xep_0030/disco.py16
-rw-r--r--sleekxmpp/plugins/xep_0030/static.py5
2 files changed, 5 insertions, 16 deletions
diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py
index 18c1dba2..eeb977b1 100644
--- a/sleekxmpp/plugins/xep_0030/disco.py
+++ b/sleekxmpp/plugins/xep_0030/disco.py
@@ -622,11 +622,7 @@ class XEP_0030(BasePlugin):
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.api['get_info'](jid,
+ info = self.api['get_info'](iq['to'],
iq['disco_info']['node'],
iq['from'],
iq)
@@ -649,7 +645,7 @@ class XEP_0030(BasePlugin):
ito = iq['to'].full
else:
ito = None
- self.api['cache_info'](iq['from'].full,
+ self.api['cache_info'](iq['from'],
iq['disco_info']['node'],
ito,
iq)
@@ -667,13 +663,9 @@ class XEP_0030(BasePlugin):
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.api['get_items'](jid,
+ items = self.api['get_items'](iq['to'],
iq['disco_items']['node'],
- iq['from'].full,
+ iq['from'],
iq)
if isinstance(items, Iq):
items.send()
diff --git a/sleekxmpp/plugins/xep_0030/static.py b/sleekxmpp/plugins/xep_0030/static.py
index 8dd412d4..dd5317d1 100644
--- a/sleekxmpp/plugins/xep_0030/static.py
+++ b/sleekxmpp/plugins/xep_0030/static.py
@@ -237,7 +237,7 @@ class StaticDisco(object):
with self.lock:
if not self.node_exists(jid, node):
if not node:
- return DiscoInfo()
+ return DiscoItems()
else:
raise XMPPError(condition='item-not-found')
else:
@@ -424,9 +424,6 @@ class StaticDisco(object):
The data parameter is not used.
"""
with self.lock:
- if isinstance(jid, JID):
- jid = jid.full
-
if not self.node_exists(jid, node, ifrom):
return None
else: