diff options
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index 5e550e064..09d59517f 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -94,16 +94,12 @@ roster_contact_changed_cb (GtkWidget *child, egg_list_box_child_changed (EGG_LIST_BOX (self), child); } -static void -individual_added (EmpathyRosterView *self, +static GtkWidget * +add_roster_contact (EmpathyRosterView *self, FolksIndividual *individual) { GtkWidget *contact; - contact = g_hash_table_lookup (self->priv->roster_contacts, individual); - if (contact != NULL) - return; - contact = empathy_roster_contact_new (individual); /* Need to refilter if online is changed */ @@ -117,6 +113,21 @@ individual_added (EmpathyRosterView *self, gtk_widget_show (contact); gtk_container_add (GTK_CONTAINER (self), contact); + return contact; +} + +static void +individual_added (EmpathyRosterView *self, + FolksIndividual *individual) +{ + GtkWidget *contact; + + contact = g_hash_table_lookup (self->priv->roster_contacts, individual); + if (contact != NULL) + return; + + contact = add_roster_contact (self, individual); + g_hash_table_insert (self->priv->roster_contacts, individual, contact); } |