From bfded43d1e27f87f4297a4c1f1bbdb677f0bf4d0 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 25 Jan 2010 19:31:48 +0100 Subject: [PATCH] don't synchronize groupchats when we synchronize contacts between 2 accounts. Fixes #5570 --- src/common/contacts.py | 10 ++++++++++ src/dialogs.py | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/common/contacts.py b/src/common/contacts.py index 439e5f5c0..7ce83dba4 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -322,6 +322,9 @@ class LegacyContactsAPI: def get_contacts_from_group(self, account, group): return self._accounts[account].contacts.get_contacts_from_group(group) + def get_contacts_jid_list(self, account): + return self._accounts[account].contacts.get_contacts_jid_list() + def get_jid_list(self, account): return self._accounts[account].contacts.get_jid_list() @@ -492,6 +495,13 @@ class Contacts(): def get_jid_list(self): return self._contacts.keys() + def get_contacts_jid_list(self): + contacts = self._contacts.keys() + for jid in self._contacts.keys(): + if self._contacts[jid][0].is_groupchat(): + contacts.remove(jid) + return contacts + def get_contact_from_full_jid(self, fjid): """ Get Contact object for specific resource of given jid diff --git a/src/dialogs.py b/src/dialogs.py index f3ff79f18..306a71ef2 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -2317,9 +2317,10 @@ class SynchroniseSelectContactsDialog: model.clear() # recover local contacts - local_jid_list = gajim.contacts.get_jid_list(self.local_account) + local_jid_list = gajim.contacts.get_contacts_jid_list(self.local_account) - remote_jid_list = gajim.contacts.get_jid_list(self.remote_account) + remote_jid_list = gajim.contacts.get_contacts_jid_list( + self.remote_account) for remote_jid in remote_jid_list: if remote_jid not in local_jid_list: iter_ = model.append()