Mercurial > libervia-backend
changeset 1300:ba73798317a7 frontends_multi_profiles
core: fixed items registration in roster management
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 06 Feb 2015 18:54:44 +0100 |
parents | 3360074a2f00 |
children | afc57b34c0a3 |
files | src/core/xmpp.py |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/xmpp.py Fri Feb 06 18:53:07 2015 +0100 +++ b/src/core/xmpp.py Fri Feb 06 18:54:44 2015 +0100 @@ -180,6 +180,8 @@ def rosterCb(self, roster): assert roster is not None # FIXME: must be managed with roster versioning self._jids = roster + for roster_item in roster.itervalues(): + self._registerItem(roster_item) def _registerItem(self, item): """Register item in local cache @@ -265,13 +267,13 @@ """Return a list of groups""" return self._groups.keys() - def getItem(self, jid): + def getItem(self, entity_jid): """Return RosterItem for a given jid - @param jid: jid of the contact + @param entity_jid: jid of the contact @return: RosterItem or None if contact is not in cache """ - return self._jids.get(jid, None) + return self._jids.get(entity_jid, None) def getJids(self): """Return all jids of the roster""" @@ -289,7 +291,7 @@ try: return self._groups[group] except KeyError: - raise exceptions.UnknownGroupError + raise exceptions.UnknownGroupError(group) class SatPresenceProtocol(xmppim.PresenceClientProtocol):