-static void
-contact_list_view_favourite_toggled_cb (
- EmpathyCellRendererActivatable *cell,
- const gchar *path_string,
- EmpathyContactListView *view)
-{
- EmpathyContactListViewPriv *priv = GET_PRIV (view);
- GtkTreeModel *model;
- GtkTreeIter iter;
- EmpathyContact *contact;
- EmpathyContactList *list;
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
- if (!gtk_tree_model_get_iter_from_string (model, &iter, path_string))
- return;
-
- gtk_tree_model_get (model, &iter,
- EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
- -1);
- if (contact == NULL)
- return;
-
- list = empathy_contact_list_store_get_list_iface (priv->store);
-
- if (empathy_contact_list_contact_is_favourite (list, contact)) {
- empathy_contact_list_remove_from_group (list, contact,
- EMPATHY_GROUP_FAVOURITES);
- } else {
- empathy_contact_list_add_to_group (list, contact,
- EMPATHY_GROUP_FAVOURITES);
- }
-
- g_object_unref (contact);
-}
-