[empathy] Added new function to get selected individual



commit 81a65a9ab520396d5ba6eb4085b4ab653bec547c
Author: Laurent Contzen <lcontzen gmail com>
Date:   Wed Jun 27 11:23:11 2012 +0200

    Added new function to get selected individual
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678875

 libempathy-gtk/empathy-roster-view.c |   13 +++++++++++++
 libempathy-gtk/empathy-roster-view.h |    2 ++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 8dc739f..3d55c3f 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 ff9ba6c..786e54d 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__*/



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