core: fixed items registration in roster management
This commit is contained in:
parent
d07237f49d
commit
b4937bef76
1 changed files with 6 additions and 4 deletions
|
|
@ -180,6 +180,8 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
|
|||
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 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
|
|||
"""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 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
|
|||
try:
|
||||
return self._groups[group]
|
||||
except KeyError:
|
||||
raise exceptions.UnknownGroupError
|
||||
raise exceptions.UnknownGroupError(group)
|
||||
|
||||
|
||||
class SatPresenceProtocol(xmppim.PresenceClientProtocol):
|
||||
|
|
|
|||
Loading…
Reference in a new issue