diff --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index 26772738..fff684d3 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -41,6 +41,16 @@ except (TypeError, AttributeError): # Error raised is not the same depending on iter_cpy.sort(key=key) return pyjamas_max(iter_cpy) + # next doesn't exist in pyjamas + def next(iterable, *args): + try: + return iterable.next() + except StopIteration as e: + if args: + return args[0] + raise e + + handler = None @@ -596,25 +606,25 @@ class QuickContactListHandler(object): return False @property - def roster_entities(self): + def roster(self): """Return all the bare JIDs of the roster entities. @return (set[jid.JID]) """ entities = set() for contact_list in self._clist.itervalues(): - entities.update(contact_list.roster_entities) + entities.update(contact_list.roster) return entities @property - def roster_entities_connected(self): + def roster_connected(self): """Return all the bare JIDs of the roster entities that are connected. @return (set[jid.JID]) """ entities = set() for contact_list in self._clist.itervalues(): - entities.update(contact_list.roster_entities_connected) + entities.update(contact_list.roster_connected) return entities @property