Include the default, unnamed group in self.client_roster.groups()

This commit is contained in:
Lance Stout 2012-06-04 11:54:25 -07:00
parent 98677fd602
commit edf65f4f52

View file

@ -119,7 +119,12 @@ class RosterNode(object):
"""Return a dictionary mapping group names to JIDs.""" """Return a dictionary mapping group names to JIDs."""
result = {} result = {}
for jid in self._jids: for jid in self._jids:
for group in self._jids[jid]['groups']: groups = self._jids[jid]['groups']
if not groups:
if '' not in result:
result[''] = []
result[''].append(jid)
for group in groups:
if group not in result: if group not in result:
result[group] = [] result[group] = []
result[group].append(jid) result[group].append(jid)