From 676324805efbe5b9ae468ecad6fdaa91cef85f53 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sat, 18 Feb 2012 11:39:47 -0800 Subject: Use JID objects when dealing with roster items. --- sleekxmpp/stanza/roster.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sleekxmpp') 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): -- cgit v1.2.3