]> git.0d.be Git - empathy.git/commitdiff
factor out add_roster_contact()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 25 May 2012 12:57:14 +0000 (14:57 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 14 Jun 2012 07:21:48 +0000 (09:21 +0200)
libempathy-gtk/empathy-roster-view.c

index 5e550e064e5fa5ba61342e78f8afce9e4921ca95..09d59517f8846d64f7ae9b6079a6bb50a5249658 100644 (file)
@@ -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);
 }