aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-individual-manager.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-10 18:54:48 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-20 19:35:44 +0800
commite445d9d5b2781ef59e1a07e97853f232c94d0dc2 (patch)
tree622d5444bbb88766e40ac413224f0f065a516f92 /libempathy/empathy-individual-manager.c
parente09695146f8ac0fad504ead9e080b70fe70d3b9b (diff)
downloadgsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.tar
gsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.tar.gz
gsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.tar.bz2
gsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.tar.lz
gsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.tar.xz
gsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.tar.zst
gsoc2013-empathy-e445d9d5b2781ef59e1a07e97853f232c94d0dc2.zip
Allow unlinking individuals through EmpathyIndividualManager
Wrap the FolksIndividualAggregator individual unlinking API in EmpathyIndividualManager with some basic error reporting (it isn't expected that unlinking will fail).
Diffstat (limited to 'libempathy/empathy-individual-manager.c')
-rw-r--r--libempathy/empathy-individual-manager.c34
1 files changed, 34 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);
+}