[empathy] factor out add_roster_contact()



commit cdb76a5ad9845785bc29fe67533201489f2adbea
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri May 25 14:57:14 2012 +0200

    factor out add_roster_contact()

 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 5e550e0..09d5951 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);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]