From edf65f4f52679f8be4c94edaf952e18f3560d14d Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 4 Jun 2012 11:54:25 -0700 Subject: [PATCH] Include the default, unnamed group in self.client_roster.groups() --- sleekxmpp/roster/single.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/roster/single.py b/sleekxmpp/roster/single.py index 518afebe..048b091e 100644 --- a/sleekxmpp/roster/single.py +++ b/sleekxmpp/roster/single.py @@ -119,7 +119,12 @@ class RosterNode(object): """Return a dictionary mapping group names to JIDs.""" result = {} 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: result[group] = [] result[group].append(jid)