core: contact deletion from roster if we have no subscription to it (behaviour may change in futur)
quick frontend: groups is updated in contactList in case of roster push
This commit is contained in:
parent
ca30c9359b
commit
279f173624
2 changed files with 17 additions and 3 deletions
|
|
@ -203,7 +203,11 @@ class QuickApp():
|
|||
if not self.check_profile(profile):
|
||||
return
|
||||
entity=JID(JabberId)
|
||||
self.rosterList[entity.short]=(dict(attributes), list(groups))
|
||||
_groups = list(groups)
|
||||
self.rosterList[entity.short]=(dict(attributes), _groups)
|
||||
if entity in self.CM:
|
||||
self.CM.update(entity, 'groups', _groups)
|
||||
self.contactList.replace(entity, self.CM.getAttr(entity, 'groups'))
|
||||
|
||||
def newMessage(self, from_jid, msg, type, to_jid, profile):
|
||||
if not self.check_profile(profile):
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ class QuickContactManagement():
|
|||
def __init__(self):
|
||||
self.__contactlist = {}
|
||||
|
||||
def __contains__(self, entity):
|
||||
return entity.short in self.__contactlist
|
||||
|
||||
def clear(self):
|
||||
"""Clear all the contact list"""
|
||||
self.__contactlist.clear()
|
||||
|
|
@ -39,6 +42,8 @@ class QuickContactManagement():
|
|||
"""Add contact to the list, update resources"""
|
||||
if not self.__contactlist.has_key(entity.short):
|
||||
self.__contactlist[entity.short] = {'resources':[]}
|
||||
if not entity.resource:
|
||||
return
|
||||
if entity.resource in self.__contactlist[entity.short]['resources']:
|
||||
self.__contactlist[entity.short]['resources'].remove(entity.resource)
|
||||
self.__contactlist[entity.short]['resources'].append(entity.resource)
|
||||
|
|
|
|||
Loading…
Reference in a new issue