[empathy] roster-view: make sure the same contact isn't added twice to the same group
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] roster-view: make sure the same contact isn't added twice to the same group
- Date: Thu, 30 Aug 2012 10:17:16 +0000 (UTC)
commit c11c1cb31e7b46f89de4fd41f9d75f2731c5ded0
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Aug 30 12:06:42 2012 +0200
roster-view: make sure the same contact isn't added twice to the same group
Calling empathy_roster_model_get_groups_for_individual() in individual_added
may have the side effect for folks to discover the contact's groups and so
fire a bunch of signals leading us to add the contact in the group.
Then we look for his groups in individual_added() and re-add him a second
time.
Fix this by making sure we won't add the same contact twice to the same group.
https://bugzilla.gnome.org/show_bug.cgi?id=683025
libempathy-gtk/empathy-roster-view.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index a820d2b..4ad2d16 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -270,6 +270,9 @@ add_to_group (EmpathyRosterView *self,
if (contacts == NULL)
return;
+ if (g_hash_table_lookup (contacts, group) != NULL)
+ return;
+
if (tp_strdiff (group, NO_GROUP))
roster_group = ensure_roster_group (self, group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]