# HG changeset patch # User Goffi # Date 1423247377 -3600 # Node ID 3dc7f61677bbb7a6339c810e1ad66082a3666a34 # Parent 1a61b18703c4563ce9380af427270163169253c8# Parent ef7e8e23b35385469296651054966efca69d1caf merged souliane commits diff -r 1a61b18703c4 -r 3dc7f61677bb frontends/src/quick_frontend/quick_chat.py --- a/frontends/src/quick_frontend/quick_chat.py Fri Feb 06 19:05:51 2015 +0100 +++ b/frontends/src/quick_frontend/quick_chat.py Fri Feb 06 19:29:37 2015 +0100 @@ -156,7 +156,10 @@ @param search (str): pattern to filter the history results @param profile (str): %(doc_profile)s """ - log.debug(_("now we print the history (%d messages)") % size) + log_msg = _(u"now we print the history") + if size != C.HISTORY_LIMIT_DEFAULT: + log_msg += _(u" (%d messages)" % size) + log.debug(log_msg) def onHistory(history): for line in history: diff -r 1a61b18703c4 -r 3dc7f61677bb frontends/src/quick_frontend/quick_contact_list.py --- a/frontends/src/quick_frontend/quick_contact_list.py Fri Feb 06 19:05:51 2015 +0100 +++ b/frontends/src/quick_frontend/quick_contact_list.py Fri Feb 06 19:29:37 2015 +0100 @@ -83,6 +83,36 @@ return False return entity in self._cache + @property + def roster_entities(self): + """Return all the bare JIDs of the roster entities. + + @return: set(jid.JID) + """ + return self._roster + + @property + def roster_entities_by_group(self): + """Return a dictionary binding the roster groups to their entities bare JIDs. + + @return: dict{unicode: set(jid.JID)} + """ + return {group: self._groups[group]['jids'] for group in self._groups} + + @property + def roster_groups_by_entity(self, contact_jid_s): + """Return a dictionary binding the entities bare JIDs to their roster groups. + + @return: dict{jid.JID: set(unicode)} + """ + result = {} + for group, data in self._groups.iteritems(): + if group is None: + continue + for entity in data['jids']: + result.setdefault(entity, set()).add(group) + return result + def fill(self): """Get all contacts from backend, and fill the widget""" def gotContacts(contacts):