[empathy/gnome-2-34] Bug 641662 — Update for libfolks API changes to IndividualAggregator
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-2-34] Bug 641662 — Update for libfolks API changes to IndividualAggregator
- Date: Fri, 18 Feb 2011 00:17:36 +0000 (UTC)
commit 6103b13b462a07a8b508ee2223ef1e5acfc8dd47
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sun Feb 6 12:14:28 2011 +0000
Bug 641662 â?? Update for libfolks API changes to IndividualAggregator
Update EmpathyIndividualManager re. changes to
IndividualAggregator.add_persona_from_details, BackendStore.enabled_backends
and BackendStore.get_backend_by_name in libfolks. Closes: bgo#641662
libempathy/empathy-individual-manager.c | 33 +++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 2 deletions(-)
---
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 0a99b7c..a8cc412 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -389,7 +389,10 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
EmpathyContact *contact)
{
EmpathyIndividualManagerPriv *priv;
- GHashTable* details;
+ FolksBackendStore *backend_store;
+ FolksBackend *backend;
+ FolksPersonaStore *persona_store;
+ GHashTable* details, *persona_stores;
TpAccount *account;
const gchar *store_id;
@@ -408,15 +411,41 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
account = empathy_contact_get_account (contact);
store_id = tp_proxy_get_object_path (TP_PROXY (account));
+ /* Get the persona store to use */
+ backend_store = folks_backend_store_dup ();
+ backend =
+ folks_backend_store_dup_backend_by_name (backend_store, "telepathy");
+
+ if (backend == NULL)
+ {
+ g_warning ("Failed to add individual from contact: couldn't get "
+ "'telepathy' backend");
+ goto finish;
+ }
+
+ persona_stores = folks_backend_get_persona_stores (backend);
+ persona_store = g_hash_table_lookup (persona_stores, store_id);
+
+ if (persona_store == NULL)
+ {
+ g_warning ("Failed to add individual from contact: couldn't get persona "
+ "store '%s'", store_id);
+ goto finish;
+ }
+
details = tp_asv_new (
"contact", G_TYPE_STRING, empathy_contact_get_id (contact),
NULL);
folks_individual_aggregator_add_persona_from_details (
- priv->aggregator, NULL, "telepathy", store_id, details,
+ priv->aggregator, NULL, persona_store, details,
aggregator_add_persona_from_details_cb, contact);
g_hash_table_destroy (details);
+
+finish:
+ tp_clear_object (&backend);
+ tp_clear_object (&backend_store);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]