diff options
author | Lance Stout <lancestout@gmail.com> | 2011-05-20 17:42:40 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-05-20 17:42:40 -0400 |
commit | c49a8e91142121251ccb2cacd3b3f0d5cd78db97 (patch) | |
tree | eb48fa075fd45993e4ee97c303eb4a5c2710bd2f /sleekxmpp/roster.py | |
parent | d3bd9cd31d3cbf99d02539ecf4d3de20eafb8c8a (diff) | |
download | slixmpp-c49a8e91142121251ccb2cacd3b3f0d5cd78db97.tar.gz slixmpp-c49a8e91142121251ccb2cacd3b3f0d5cd78db97.tar.bz2 slixmpp-c49a8e91142121251ccb2cacd3b3f0d5cd78db97.tar.xz slixmpp-c49a8e91142121251ccb2cacd3b3f0d5cd78db97.zip |
Save progress
Diffstat (limited to 'sleekxmpp/roster.py')
-rw-r--r-- | sleekxmpp/roster.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sleekxmpp/roster.py b/sleekxmpp/roster.py index 1972a92e..55af1e46 100644 --- a/sleekxmpp/roster.py +++ b/sleekxmpp/roster.py @@ -8,6 +8,8 @@ import logging +from sleekxmpp.xmlstream import JID + class Roster(object): @@ -64,7 +66,7 @@ class Roster(object): Arguments: key -- Return the roster for this JID. """ - if not isinstance(key, str): + if isinstance(key, JID): key = key.bare if key not in self._rosters: self.add(key) @@ -87,7 +89,7 @@ class Roster(object): Arguments: node -- The JID for the new roster node. """ - if not isinstance(node, str): + if isinstance(node, JID): node = node.bare if node not in self._rosters: self._rosters[node] = RosterNode(self.xmpp, node, self.db) @@ -169,7 +171,7 @@ class RosterNode(object): A new item entry will be created if one does not already exist. """ - if not isinstance(key, str): + if isinstance(key, JID): key = key.bare if key not in self._jids: self.add(key, save=True) @@ -228,7 +230,7 @@ class RosterNode(object): if one is used. Defaults to False. """ - if not isinstance(jid, str): + if isinstance(jid, JID): key = jid.bare state = {'name': name, 'groups': groups or [], |