aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-07-02 19:11:06 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:36 +0800
commitc9602a81b0f64f20c1927947c8e456929c521119 (patch)
tree9392bc09b885af8c32cec723cfa85075f8ffe5a1 /libempathy-gtk/empathy-contact-widget.c
parentac58a4101765c64d94c18d10c59fde7fa67ea4ae (diff)
downloadgsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.tar
gsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.tar.gz
gsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.tar.bz2
gsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.tar.lz
gsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.tar.xz
gsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.tar.zst
gsoc2013-empathy-c9602a81b0f64f20c1927947c8e456929c521119.zip
Fix setting favourites from the contact editing dialogue
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 76271c6fc..851aa5313 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1534,14 +1534,18 @@ contact_widget_contact_update (EmpathyContactWidget *information)
if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE)
{
- gboolean is_favourite;
-
- is_favourite = empathy_contact_list_is_favourite (
- EMPATHY_CONTACT_LIST (information->manager),
+ FolksIndividual *individual = folks_individual_from_empathy_contact (
information->contact);
- contact_widget_favourites_changed_cb (information->manager,
- information->contact, is_favourite, information);
+ if (individual)
+ {
+ gboolean is_favourite = folks_favourite_get_is_favourite (
+ FOLKS_FAVOURITE (individual));
+ contact_widget_favourites_changed_cb (information->manager,
+ information->contact, is_favourite, information);
+
+ g_object_unref (individual);
+ }
}
gtk_widget_show (information->label_alias);
@@ -1667,19 +1671,14 @@ static void
favourite_toggled_cb (GtkToggleButton *button,
EmpathyContactWidget *information)
{
- gboolean active;
-
- active = gtk_toggle_button_get_active (button);
+ FolksIndividual *individual = folks_individual_from_empathy_contact (
+ information->contact);
- if (active)
- {
- empathy_contact_list_add_to_favourites (
- EMPATHY_CONTACT_LIST (information->manager), information->contact);
- }
- else
+ if (individual)
{
- empathy_contact_list_remove_from_favourites (
- EMPATHY_CONTACT_LIST (information->manager), information->contact);
+ gboolean active = gtk_toggle_button_get_active (button);
+ folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), active);
+ g_object_unref (individual);
}
}