[empathy] Allow linking personas through EmpathyIndividualManager
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Allow linking personas through EmpathyIndividualManager
- Date: Wed, 11 Aug 2010 16:37:57 +0000 (UTC)
commit 9d23b85fc16e7bc4b83af2850fdd2e96909b09d9
Author: Philip Withnall <philip withnall collabora co uk>
Date: Mon Aug 9 11:25:20 2010 +0100
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).
libempathy/empathy-individual-manager.c | 34 +++++++++++++++++++++++++++++++
libempathy/empathy-individual-manager.h | 3 ++
2 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 32f9726..3fbaab4 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 66014bc..0fe639d 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__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]