]> git.0d.be Git - empathy.git/commitdiff
roster-view: make sure the same contact isn't added twice to the same group
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 30 Aug 2012 10:06:42 +0000 (12:06 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 30 Aug 2012 10:08:50 +0000 (12:08 +0200)
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

index a820d2b62f7b1bf32f016d722f3123428889c2ea..4ad2d16ef79ffae9cb8492e7020e8cef9d5cbffd 100644 (file)
@@ -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);