From f1db2fc156aabba78e4aa726b441c434d48e9136 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 19 Jan 2011 12:08:28 -0500 Subject: Fix error in disco add_item. None values were not being treated properly. --- sleekxmpp/plugins/xep_0030/disco.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sleekxmpp/plugins/xep_0030/disco.py') 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 + -- cgit v1.2.3