mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Use JID objects when dealing with roster items.
This commit is contained in:
parent
7d74a7b027
commit
676324805e
1 changed files with 6 additions and 0 deletions
|
@ -97,6 +97,12 @@ class RosterItem(ElementBase):
|
||||||
interfaces = set(('jid', 'name', 'subscription', 'ask',
|
interfaces = set(('jid', 'name', 'subscription', 'ask',
|
||||||
'approved', 'groups'))
|
'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):
|
def get_groups(self):
|
||||||
groups = []
|
groups = []
|
||||||
for group in self.xml.findall('{%s}group' % self.namespace):
|
for group in self.xml.findall('{%s}group' % self.namespace):
|
||||||
|
|
Loading…
Reference in a new issue