summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-01-19 12:08:28 -0500
committerLance Stout <lancestout@gmail.com>2011-01-19 12:08:28 -0500
commitf1db2fc156aabba78e4aa726b441c434d48e9136 (patch)
tree8cce09b42f2bc599ae485af0e8b1b300033fedc8 /sleekxmpp/plugins
parent2004ddd678fae9af590db2065478d2592bc2530b (diff)
downloadslixmpp-f1db2fc156aabba78e4aa726b441c434d48e9136.tar.gz
slixmpp-f1db2fc156aabba78e4aa726b441c434d48e9136.tar.bz2
slixmpp-f1db2fc156aabba78e4aa726b441c434d48e9136.tar.xz
slixmpp-f1db2fc156aabba78e4aa726b441c434d48e9136.zip
Fix error in disco add_item.
None values were not being treated properly.
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0030/disco.py7
-rw-r--r--sleekxmpp/plugins/xep_0030/static.py5
2 files changed, 8 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py
index 72dda1db..67468735 100644
--- a/sleekxmpp/plugins/xep_0030/disco.py
+++ b/sleekxmpp/plugins/xep_0030/disco.py
@@ -345,7 +345,7 @@ class xep_0030(base_plugin):
"""
self._run_node_handler('del_items', jid, node, kwargs)
- def add_item(self, jid=None, name='', node=None, subnode='', ijid=None):
+ def add_item(self, jid='', name='', node=None, subnode='', ijid=None):
"""
Add a new item element to the given JID/node combination.
@@ -359,10 +359,12 @@ class xep_0030(base_plugin):
subnode -- Optional node for the item.
ijid -- The JID to modify.
"""
+ if jid is None:
+ jid = ''
kwargs = {'ijid': jid,
'name': name,
'inode': subnode}
- self._run_node_handler('add_item', jid, node, kwargs)
+ self._run_node_handler('add_item', ijid, node, kwargs)
def del_item(self, jid=None, node=None, **kwargs):
"""
@@ -604,3 +606,4 @@ class xep_0030(base_plugin):
"Using default disco#info feature.")
info.add_feature(info.namespace)
return info
+
diff --git a/sleekxmpp/plugins/xep_0030/static.py b/sleekxmpp/plugins/xep_0030/static.py
index eff67f02..f957c84c 100644
--- a/sleekxmpp/plugins/xep_0030/static.py
+++ b/sleekxmpp/plugins/xep_0030/static.py
@@ -247,8 +247,8 @@ class StaticDisco(object):
self.add_node(jid, node)
self.nodes[(jid, node)]['items'].add_item(
data.get('ijid', ''),
- node=data.get('inode', None),
- name=data.get('name', None))
+ node=data.get('inode', ''),
+ name=data.get('name', ''))
def del_item(self, jid, node, data):
"""
@@ -262,3 +262,4 @@ class StaticDisco(object):
self.nodes[(jid, node)]['items'].del_item(
data.get('ijid', ''),
node=data.get('inode', None))
+