diff options
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-contact.c | 19 | ||||
-rw-r--r-- | libempathy/empathy-individual-manager.c | 19 |
2 files changed, 36 insertions, 2 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 9a2bd8fb5..6842cde09 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -662,6 +662,22 @@ empathy_contact_set_alias (EmpathyContact *contact, g_object_unref (contact); } +static void +groups_change_group_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + FolksGroups *groups = FOLKS_GROUPS (source); + GError *error = NULL; + + folks_groups_change_group_finish (groups, result, &error); + if (error != NULL) + { + g_warning ("failed to change group: %s", error->message); + g_clear_error (&error); + } +} + void empathy_contact_change_group (EmpathyContact *contact, const gchar *group, gboolean is_member) @@ -679,7 +695,8 @@ empathy_contact_change_group (EmpathyContact *contact, const gchar *group, if (persona != NULL) { if (FOLKS_IS_GROUPS (persona)) - folks_groups_change_group (FOLKS_GROUPS (persona), group, is_member); + folks_groups_change_group (FOLKS_GROUPS (persona), group, is_member, + groups_change_group_cb, contact); return; } diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c index 32442f94c..55541b299 100644 --- a/libempathy/empathy-individual-manager.c +++ b/libempathy/empathy-individual-manager.c @@ -368,11 +368,28 @@ empathy_individual_manager_remove (EmpathyIndividualManager *self, } static void +groups_change_group_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + FolksGroups *groups = FOLKS_GROUPS (source); + GError *error = NULL; + + folks_groups_change_group_finish (groups, result, &error); + if (error != NULL) + { + g_warning ("failed to change group: %s", error->message); + g_clear_error (&error); + } +} + +static void remove_group_cb (const gchar *id, FolksIndividual *individual, const gchar *group) { - folks_groups_change_group (FOLKS_GROUPS (individual), group, FALSE); + folks_groups_change_group (FOLKS_GROUPS (individual), group, FALSE, + groups_change_group_cb, NULL); } void |