aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2011-02-06 20:14:28 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2011-02-18 07:46:07 +0800
commitd008f215bc41f4e69ff01879047ec946a4370148 (patch)
tree3cff55747073d4cae197c3db785ae9c69182779f /libempathy
parent8e789be3d95d5e232bbde41094f5e0e426109132 (diff)
downloadgsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.tar
gsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.tar.gz
gsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.tar.bz2
gsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.tar.lz
gsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.tar.xz
gsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.tar.zst
gsoc2013-empathy-d008f215bc41f4e69ff01879047ec946a4370148.zip
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
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-individual-manager.c33
-rw-r--r--libempathy/empathy-utils.c2
2 files changed, 32 insertions, 3 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 29470b87e..894ae648b 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -383,7 +383,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;
@@ -402,15 +405,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
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index b23071a29..7ab59814f 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -837,7 +837,7 @@ empathy_get_persona_store_for_connection (TpConnection *connection)
TpfPersonaStore *result = NULL;
backend_store = folks_backend_store_dup ();
- backend = folks_backend_store_get_backend_by_name (backend_store,
+ backend = folks_backend_store_dup_backend_by_name (backend_store,
"telepathy");
if (backend != NULL)
{