aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy/empathy-individual-manager.c48
-rw-r--r--libempathy/empathy-individual-manager.h10
2 files changed, 58 insertions, 0 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 1132f5816..97be8b8a7 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -440,6 +440,7 @@ individual_manager_dispose (GObject *object)
EmpathyIndividualManagerPriv *priv = GET_PRIV (object);
g_hash_table_unref (priv->individuals);
+
tp_clear_object (&priv->aggregator);
G_OBJECT_CLASS (empathy_individual_manager_parent_class)->dispose (object);
@@ -908,3 +909,50 @@ empathy_individual_manager_get_top_individuals (EmpathyIndividualManager *self)
return priv->top_individuals;
}
+
+static void
+unprepare_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ GError *error = NULL;
+ GSimpleAsyncResult *my_result = user_data;
+
+ folks_individual_aggregator_unprepare_finish (
+ FOLKS_INDIVIDUAL_AGGREGATOR (source), result, &error);
+
+ if (error != NULL)
+ {
+ DEBUG ("Failed to unprepare the aggregator: %s", error->message);
+ g_simple_async_result_take_error (my_result, error);
+ }
+
+ g_simple_async_result_complete (my_result);
+ g_object_unref (my_result);
+}
+
+void
+empathy_individual_manager_unprepare_async (
+ EmpathyIndividualManager *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ EmpathyIndividualManagerPriv *priv = GET_PRIV (self);
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
+ empathy_individual_manager_unprepare_async);
+
+ folks_individual_aggregator_unprepare (priv->aggregator, unprepare_cb,
+ result);
+}
+
+gboolean
+empathy_individual_manager_unprepare_finish (
+ EmpathyIndividualManager *self,
+ GAsyncResult *result,
+ GError **error)
+{
+ empathy_implement_finish_void (self,
+ empathy_individual_manager_unprepare_async)
+}
diff --git a/libempathy/empathy-individual-manager.h b/libempathy/empathy-individual-manager.h
index d2a5fe90b..fc2704373 100644
--- a/libempathy/empathy-individual-manager.h
+++ b/libempathy/empathy-individual-manager.h
@@ -89,5 +89,15 @@ gboolean empathy_individual_manager_get_contacts_loaded (
GList * empathy_individual_manager_get_top_individuals (
EmpathyIndividualManager *self);
+void empathy_individual_manager_unprepare_async (
+ EmpathyIndividualManager *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean empathy_individual_manager_unprepare_finish (
+ EmpathyIndividualManager *self,
+ GAsyncResult *result,
+ GError **error);
+
G_END_DECLS
#endif /* __EMPATHY_INDIVIDUAL_MANAGER_H__ */