aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-roster-view.c13
-rw-r--r--libempathy-gtk/empathy-roster-view.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 8dc739fde..3d55c3fa4 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -1606,3 +1606,16 @@ empathy_roster_view_remove_event (EmpathyRosterView *self,
}
}
}
+
+FolksIndividual *
+empathy_roster_view_get_selected_individual (EmpathyRosterView *self)
+{
+ GtkWidget *child;
+
+ child = egg_list_box_get_selected_child (EGG_LIST_BOX (self));
+
+ if (!EMPATHY_IS_ROSTER_CONTACT (child))
+ return NULL;
+
+ return empathy_roster_contact_get_individual (EMPATHY_ROSTER_CONTACT (child));
+}
diff --git a/libempathy-gtk/empathy-roster-view.h b/libempathy-gtk/empathy-roster-view.h
index ff9ba6c57..786e54d1f 100644
--- a/libempathy-gtk/empathy-roster-view.h
+++ b/libempathy-gtk/empathy-roster-view.h
@@ -81,6 +81,8 @@ FolksIndividual * empathy_roster_view_get_individual_at_y (
gint y,
GtkWidget **out_child);
+FolksIndividual * empathy_roster_view_get_selected_individual (EmpathyRosterView *self);
+
G_END_DECLS
#endif /* #ifndef __EMPATHY_ROSTER_VIEW_H__*/