aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-individual-manager.c34
-rw-r--r--libempathy/empathy-individual-manager.h4
2 files changed, 38 insertions, 0 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 3fbaab408..4d3eabb22 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -568,3 +568,37 @@ empathy_individual_manager_link_personas (EmpathyIndividualManager *self,
folks_individual_aggregator_link_personas (priv->aggregator, personas,
(GAsyncReadyCallback) link_personas_cb, NULL);
}
+
+static void
+unlink_individual_cb (FolksIndividualAggregator *aggregator,
+ GAsyncResult *async_result,
+ gpointer user_data)
+{
+ GError *error = NULL;
+
+ folks_individual_aggregator_unlink_individual_finish (aggregator,
+ async_result, &error);
+
+ if (error != NULL)
+ {
+ g_warning ("Failed to unlink individual: %s", error->message);
+ g_clear_error (&error);
+ }
+}
+
+void
+empathy_individual_manager_unlink_individual (EmpathyIndividualManager *self,
+ FolksIndividual *individual)
+{
+ EmpathyIndividualManagerPriv *priv;
+
+ g_return_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self));
+ g_return_if_fail (FOLKS_IS_INDIVIDUAL (individual));
+
+ priv = GET_PRIV (self);
+
+ DEBUG ("Unlinking individual '%s'", folks_individual_get_id (individual));
+
+ folks_individual_aggregator_unlink_individual (priv->aggregator, individual,
+ (GAsyncReadyCallback) unlink_individual_cb, NULL);
+}
diff --git a/libempathy/empathy-individual-manager.h b/libempathy/empathy-individual-manager.h
index 0fe639d0c..72104fc40 100644
--- a/libempathy/empathy-individual-manager.h
+++ b/libempathy/empathy-individual-manager.h
@@ -90,5 +90,9 @@ empathy_individual_manager_get_flags_for_connection (
void empathy_individual_manager_link_personas (EmpathyIndividualManager *self,
GList *personas);
+void empathy_individual_manager_unlink_individual (
+ EmpathyIndividualManager *self,
+ FolksIndividual *individual);
+
G_END_DECLS
#endif /* __EMPATHY_INDIVIDUAL_MANAGER_H__ */