summaryrefslogtreecommitdiff
path: root/sleekxmpp/roster/multi.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/multi.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/multi.py')
-rw-r--r--sleekxmpp/roster/multi.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/sleekxmpp/roster/multi.py b/sleekxmpp/roster/multi.py
index 9a04aebb..5d070ec8 100644
--- a/sleekxmpp/roster/multi.py
+++ b/sleekxmpp/roster/multi.py
@@ -94,10 +94,12 @@ class Roster(object):
Arguments:
key -- Return the roster for this JID.
"""
- if isinstance(key, JID):
- key = key.bare
if key is None:
- key = self.xmpp.boundjid.bare
+ key = self.xmpp.boundjid
+ if not isinstance(key, JID):
+ key = JID(key)
+ key = key.bare
+
if key not in self._rosters:
self.add(key)
self._rosters[key].auto_authorize = self.auto_authorize
@@ -119,8 +121,10 @@ class Roster(object):
Arguments:
node -- The JID for the new roster node.
"""
- if isinstance(node, JID):
- node = node.bare
+ if not isinstance(node, JID):
+ node = JID(node)
+
+ node = node.bare
if node not in self._rosters:
self._rosters[node] = RosterNode(self.xmpp, node, self.db)