aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorLaurent Contzen <lcontzen@gmail.com>2012-08-08 21:15:14 +0800
committerLaurent Contzen <lcontzen@gmail.com>2012-08-09 18:51:41 +0800
commit9282dff7d3ec6f4ba33a2b91fc4d415463503d9a (patch)
tree63ad715a5b31e56cfcd5795c411cf0b22896be4e /libempathy-gtk
parent9e5365a93f34c68bb3fa4ca41f10ed37b5ded262 (diff)
downloadgsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.tar
gsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.tar.gz
gsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.tar.bz2
gsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.tar.lz
gsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.tar.xz
gsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.tar.zst
gsoc2013-empathy-9282dff7d3ec6f4ba33a2b91fc4d415463503d9a.zip
Implemented _get_groups_for_individual
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-roster-model-aggregator.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-model-aggregator.c b/libempathy-gtk/empathy-roster-model-aggregator.c
index fd06e4449..ded4ec291 100644
--- a/libempathy-gtk/empathy-roster-model-aggregator.c
+++ b/libempathy-gtk/empathy-roster-model-aggregator.c
@@ -312,8 +312,34 @@ empathy_roster_model_aggregator_get_individuals (EmpathyRosterModel *model)
return g_hash_table_get_values (self->priv->individuals);
}
+static GList *
+empathy_roster_model_aggregator_get_groups_for_individual (
+ EmpathyRosterModel *model,
+ FolksIndividual *individual)
+{
+ GList *groups_list = NULL;
+ GeeSet *groups_set;
+
+ groups_set = folks_group_details_get_groups (
+ FOLKS_GROUP_DETAILS (individual));
+ if (gee_collection_get_size (GEE_COLLECTION (groups_set)) > 0)
+ {
+ GeeIterator *iter = gee_iterable_iterator (GEE_ITERABLE (groups_set));
+
+ while (iter != NULL && gee_iterator_next (iter))
+ {
+ groups_list = g_list_prepend (groups_list, gee_iterator_get (iter));
+ }
+ g_clear_object (&iter);
+ }
+
+ return groups_list;
+}
+
static void
roster_model_iface_init (EmpathyRosterModelInterface *iface)
{
iface->get_individuals = empathy_roster_model_aggregator_get_individuals;
+ iface->get_groups_for_individual =
+ empathy_roster_model_aggregator_get_groups_for_individual;
}