when we remove a contact that has subcontacts or is a subcontact, update meta contacts info stored on the server

This commit is contained in:
Yann Leboulanger 2006-01-31 21:59:12 +00:00
parent 9f4753cc06
commit f22b455da8
2 changed files with 9 additions and 0 deletions

View File

@ -164,6 +164,11 @@ class Contacts:
if not self._contacts[account].has_key(jid):
return
del self._contacts[account][jid]
if self._parent_meta_contacts[account].has_key(jid):
remove_subcontact(account, jid)
if self._children_meta_contacts[account].has_key(jid):
for cjid in self._children_meta_contacts[account][jid]:
self.remove_subcontact(account, cjid)
def get_contact(self, account, jid, resource = None):
'''Returns the list of contact instances for this jid (one per resource)

View File

@ -1527,7 +1527,11 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
gajim.connections[account].unsubscribe(contact.jid, remove_auth)
for u in gajim.contacts.get_contact(account, contact.jid):
self.remove_contact(u, account)
ccs = gajim.contacts.get_children_contacts(account, contact)
gajim.contacts.remove_jid(account, u.jid)
for cc in ccs:
cc.groups = contact.groups
self.add_contact_to_roster(cc.jid, account)
if gajim.interface.msg_win_mgr.has_window(contact.jid, account):
c = gajim.contacts.create_contact(jid = contact.jid,
name = contact.name, groups = [_('Not in Roster')],