aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-07-02 18:29:05 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:36 +0800
commit265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179 (patch)
treea223d9aaab0b6eb2ca23068480f3fbc9003f05e8 /libempathy-gtk
parent0919a8a5cc60ddda3a6d727533c926fa691617d2 (diff)
downloadgsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.tar
gsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.tar.gz
gsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.tar.bz2
gsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.tar.lz
gsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.tar.xz
gsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.tar.zst
gsoc2013-empathy-265ea7ef4abb3df7cf6d8e1c9f4c5bfe68763179.zip
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.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c28
1 files changed, 15 insertions, 13 deletions
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