[empathy: 3/4] Adjust for signature change in folks_groups_change_group()
- From: Travis Reitter <treitter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 3/4] Adjust for signature change in folks_groups_change_group()
- Date: Tue, 27 Jul 2010 13:48:37 +0000 (UTC)
commit a976f8193404e5c89d0a9a9051f629057e200f9b
Author: Travis Reitter <treitter gmail com>
Date: Mon Jul 26 18:49:35 2010 +0200
Adjust for signature change in folks_groups_change_group()
libempathy-gtk/empathy-individual-view.c | 22 ++++++++++++++++++++--
libempathy/empathy-contact.c | 19 ++++++++++++++++++-
libempathy/empathy-individual-manager.c | 19 ++++++++++++++++++-
3 files changed, 56 insertions(+), 4 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index ef4f938..7083b23 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -320,6 +320,22 @@ OUT:
}
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
individual_view_handle_drag (EmpathyIndividualView *self,
FolksIndividual *individual,
const gchar *old_group,
@@ -349,10 +365,12 @@ individual_view_handle_drag (EmpathyIndividualView *self,
}
if (new_group != NULL)
- folks_groups_change_group (FOLKS_GROUPS (individual), new_group, TRUE);
+ folks_groups_change_group (FOLKS_GROUPS (individual), new_group, TRUE,
+ groups_change_group_cb, NULL);
if (old_group != NULL && action == GDK_ACTION_MOVE)
- folks_groups_change_group (FOLKS_GROUPS (individual), old_group, FALSE);
+ folks_groups_change_group (FOLKS_GROUPS (individual), old_group, FALSE,
+ groups_change_group_cb, NULL);
}
static gboolean
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 9a2bd8f..6842cde 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 32442f9..55541b2 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]