diff options
author | Lance Stout <lancestout@gmail.com> | 2012-02-18 11:39:47 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-02-18 11:39:47 -0800 |
commit | 676324805efbe5b9ae468ecad6fdaa91cef85f53 (patch) | |
tree | 2a60b168d88f15b70d6da6d8b19b84d2d1c7bf9d /sleekxmpp/stanza/roster.py | |
parent | 7d74a7b0271c709e80f1c25e67a57dcc98d5280a (diff) | |
download | slixmpp-676324805efbe5b9ae468ecad6fdaa91cef85f53.tar.gz slixmpp-676324805efbe5b9ae468ecad6fdaa91cef85f53.tar.bz2 slixmpp-676324805efbe5b9ae468ecad6fdaa91cef85f53.tar.xz slixmpp-676324805efbe5b9ae468ecad6fdaa91cef85f53.zip |
Use JID objects when dealing with roster items.
Diffstat (limited to 'sleekxmpp/stanza/roster.py')
-rw-r--r-- | sleekxmpp/stanza/roster.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sleekxmpp/stanza/roster.py b/sleekxmpp/stanza/roster.py index c7ea4147..0b34d03b 100644 --- a/sleekxmpp/stanza/roster.py +++ b/sleekxmpp/stanza/roster.py @@ -97,6 +97,12 @@ class RosterItem(ElementBase): interfaces = set(('jid', 'name', 'subscription', 'ask', 'approved', 'groups')) + def get_jid(self): + return JID(self._get_attr('jid', '')) + + def set_jid(self, jid): + self._set_attr('jid', str(jid)) + def get_groups(self): groups = [] for group in self.xml.findall('{%s}group' % self.namespace): |