aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-25 20:57:14 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-14 15:21:48 +0800
commitcdb76a5ad9845785bc29fe67533201489f2adbea (patch)
treed9f9fb936856fb8a3bbbd891065881bf80a15f00 /libempathy-gtk
parent19d8f63a98e9ecd1ef4af765f72ef3769e735bb9 (diff)
downloadgsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.tar
gsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.tar.gz
gsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.tar.bz2
gsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.tar.lz
gsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.tar.xz
gsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.tar.zst
gsoc2013-empathy-cdb76a5ad9845785bc29fe67533201489f2adbea.zip
factor out add_roster_contact()
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-roster-view.c23
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);
}