aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-09 18:25:20 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-12 00:34:55 +0800
commit9d23b85fc16e7bc4b83af2850fdd2e96909b09d9 (patch)
treeb80e382a9df0ccc233fdff03ff14acfcadce44b7 /libempathy
parent4b7d482ea72ad143c4ed2c7b778581ed669723e3 (diff)
downloadgsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.tar
gsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.tar.gz
gsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.tar.bz2
gsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.tar.lz
gsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.tar.xz
gsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.tar.zst
gsoc2013-empathy-9d23b85fc16e7bc4b83af2850fdd2e96909b09d9.zip
Allow linking personas through EmpathyIndividualManager
Wrap the FolksIndividualAggregator persona linking API in EmpathyIndividualManager with some basic error reporting (it isn't expected that linking will fail).
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-individual-manager.c34
-rw-r--r--libempathy/empathy-individual-manager.h3
2 files changed, 37 insertions, 0 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 32f972608..3fbaab408 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -534,3 +534,37 @@ empathy_individual_manager_get_flags_for_connection (
return flags;
}
+
+static void
+link_personas_cb (FolksIndividualAggregator *aggregator,
+ GAsyncResult *async_result,
+ gpointer user_data)
+{
+ GError *error = NULL;
+
+ folks_individual_aggregator_link_personas_finish (aggregator, async_result,
+ &error);
+
+ if (error != NULL)
+ {
+ g_warning ("Failed to link personas: %s", error->message);
+ g_clear_error (&error);
+ }
+}
+
+void
+empathy_individual_manager_link_personas (EmpathyIndividualManager *self,
+ GList *personas)
+{
+ EmpathyIndividualManagerPriv *priv;
+
+ g_return_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self));
+ g_return_if_fail (personas != NULL);
+
+ priv = GET_PRIV (self);
+
+ DEBUG ("Linking %u personas", g_list_length (personas));
+
+ folks_individual_aggregator_link_personas (priv->aggregator, personas,
+ (GAsyncReadyCallback) link_personas_cb, NULL);
+}
diff --git a/libempathy/empathy-individual-manager.h b/libempathy/empathy-individual-manager.h
index 66014bcbb..0fe639d0c 100644
--- a/libempathy/empathy-individual-manager.h
+++ b/libempathy/empathy-individual-manager.h
@@ -87,5 +87,8 @@ empathy_individual_manager_get_flags_for_connection (
EmpathyIndividualManager *manager,
TpConnection *connection);
+void empathy_individual_manager_link_personas (EmpathyIndividualManager *self,
+ GList *personas);
+
G_END_DECLS
#endif /* __EMPATHY_INDIVIDUAL_MANAGER_H__ */