]> git.0d.be Git - empathy.git/commitdiff
roster-view: add_to_displayed: get the proper EmpathyRosterGroup object
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 19 Jun 2012 09:40:19 +0000 (11:40 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 19 Jun 2012 11:30:44 +0000 (13:30 +0200)
The contacts hash table is a group-name => EmpathyRosterContact mapping. We
need to use the self->priv->roster_groups hash to get the EmpathyRosterGroup
object which is the one we want to refilter.

https://bugzilla.gnome.org/show_bug.cgi?id=678205

libempathy-gtk/empathy-roster-view.c

index a2033f2168aaff5ec8c46433931b41f1b096bd67..1e98efcfe253feac8a21a72d5bcc77d71df95321 100644 (file)
@@ -715,7 +715,7 @@ add_to_displayed (EmpathyRosterView *self,
   FolksIndividual *individual;
   GHashTable *contacts;
   GHashTableIter iter;
-  gpointer v;
+  gpointer k;
 
   if (g_hash_table_lookup (self->priv->displayed_contacts, contact) != NULL)
     return;
@@ -731,9 +731,14 @@ add_to_displayed (EmpathyRosterView *self,
     return;
 
   g_hash_table_iter_init (&iter, contacts);
-  while (g_hash_table_iter_next (&iter, NULL, &v))
+  while (g_hash_table_iter_next (&iter, &k, NULL))
     {
-      GtkWidget *group = GTK_WIDGET (v);
+      const gchar *group_name = k;
+      GtkWidget *group;
+
+      group = g_hash_table_lookup (self->priv->roster_groups, group_name);
+      if (group == NULL)
+        continue;
 
       egg_list_box_child_changed (EGG_LIST_BOX (self), group);
     }