some check in meta contacts. See #1627
This commit is contained in:
parent
a236ec416e
commit
6505d57f38
1 changed files with 6 additions and 2 deletions
|
@ -218,16 +218,20 @@ class Contacts:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def define_meta_contacts(self, account, children_list):
|
def define_meta_contacts(self, account, children_list):
|
||||||
self._children_meta_contacts[account] = children_list
|
|
||||||
self._parent_meta_contacts[account] = {}
|
self._parent_meta_contacts[account] = {}
|
||||||
for parent_jid in children_list:
|
for parent_jid in children_list:
|
||||||
|
parent_list = self._children_meta_contacts[account][parent_jid] = []
|
||||||
for children_jid in children_list[parent_jid]:
|
for children_jid in children_list[parent_jid]:
|
||||||
|
if not children_jid in parent_list[parent_jid]:
|
||||||
|
parent_list[parent_jid].append(children_jid)
|
||||||
self._parent_meta_contacts[account][children_jid] = parent_jid
|
self._parent_meta_contacts[account][children_jid] = parent_jid
|
||||||
|
|
||||||
def add_subcontact(self, account, parent_jid, child_jid):
|
def add_subcontact(self, account, parent_jid, child_jid):
|
||||||
self._parent_meta_contacts[account][child_jid] = parent_jid
|
self._parent_meta_contacts[account][child_jid] = parent_jid
|
||||||
if self._children_meta_contacts[account].has_key(parent_jid):
|
if self._children_meta_contacts[account].has_key(parent_jid):
|
||||||
self._children_meta_contacts[account][parent_jid].append(child_jid)
|
list = self._children_meta_contacts[account][parent_jid]
|
||||||
|
if not child_jid in list:
|
||||||
|
list.append(child_jid)
|
||||||
else:
|
else:
|
||||||
self._children_meta_contacts[account][parent_jid] = [child_jid]
|
self._children_meta_contacts[account][parent_jid] = [child_jid]
|
||||||
common.gajim.connections[account].store_meta_contacts(
|
common.gajim.connections[account].store_meta_contacts(
|
||||||
|
|
Loading…
Add table
Reference in a new issue