summaryrefslogtreecommitdiff
path: root/sleekxmpp/roster/single.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-20 00:25:32 -0700
committerLance Stout <lancestout@gmail.com>2012-07-20 00:25:32 -0700
commit060c9ab6794cbe6c62c312b1f42bd3767ff66b80 (patch)
tree4802e7d13643dc4546e44bdd2e135dd9ad73b34c /sleekxmpp/roster/single.py
parent78f03253983779673beaf3c102ae315707a49d2c (diff)
parentacd9c32a9f8ba5476ac238a7536c838789ed4ab5 (diff)
downloadslixmpp-060c9ab6794cbe6c62c312b1f42bd3767ff66b80.tar.gz
slixmpp-060c9ab6794cbe6c62c312b1f42bd3767ff66b80.tar.bz2
slixmpp-060c9ab6794cbe6c62c312b1f42bd3767ff66b80.tar.xz
slixmpp-060c9ab6794cbe6c62c312b1f42bd3767ff66b80.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/roster/single.py')
-rw-r--r--sleekxmpp/roster/single.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/sleekxmpp/roster/single.py b/sleekxmpp/roster/single.py
index f8c9c781..f080ae8a 100644
--- a/sleekxmpp/roster/single.py
+++ b/sleekxmpp/roster/single.py
@@ -89,8 +89,11 @@ class RosterNode(object):
A new item entry will be created if one does not already exist.
"""
- if isinstance(key, JID):
- key = key.bare
+ if key is None:
+ key = JID('')
+ if not isinstance(key, JID):
+ key = JID(key)
+ key = key.bare
if key not in self._jids:
self.add(key, save=True)
return self._jids[key]
@@ -101,8 +104,11 @@ class RosterNode(object):
To remove an item from the server, use the remove() method.
"""
- if isinstance(key, JID):
- key = key.bare
+ if key is None:
+ key = JID('')
+ if not isinstance(key, JID):
+ key = JID(key)
+ key = key.bare
if key in self._jids:
del self._jids[key]