From 265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 2 Jul 2010 11:29:05 +0100 Subject: Re-enable changing individuals' groups This introduces a hacky function to return the individual for a given EmpathyContact, which should go away once we break the assumption that individuals are 1:1 with contacts. --- libempathy-gtk/empathy-contact-widget.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 024128151..82b638182 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -579,18 +579,15 @@ contact_widget_cell_toggled (GtkCellRendererToggle *cell, if (group) { - if (enabled) - { - empathy_contact_list_remove_from_group ( - EMPATHY_CONTACT_LIST (information->manager), information->contact, - group); - } - else + FolksIndividual *individual = folks_individual_from_empathy_contact ( + information->contact); + + if (individual) { - empathy_contact_list_add_to_group ( - EMPATHY_CONTACT_LIST (information->manager), information->contact, - group); + folks_groups_change_group (FOLKS_GROUPS (individual), group, !enabled); + g_object_unref (individual); } + g_free (group); } } @@ -797,6 +794,7 @@ contact_widget_button_group_clicked_cb (GtkButton *button, GtkTreeView *view; GtkListStore *store; GtkTreeIter iter; + FolksIndividual *individual; const gchar *group; view = GTK_TREE_VIEW (information->treeview_groups); @@ -810,9 +808,13 @@ contact_widget_button_group_clicked_cb (GtkButton *button, COL_ENABLED, TRUE, -1); - empathy_contact_list_add_to_group ( - EMPATHY_CONTACT_LIST (information->manager), information->contact, - group); + individual = folks_individual_from_empathy_contact (information->contact); + + if (individual) + { + folks_groups_change_group (FOLKS_GROUPS (individual), group, TRUE); + g_object_unref (individual); + } } static void -- cgit v1.2.3