diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-03-28 21:54:45 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-04-02 15:28:47 +0800 |
commit | 7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd (patch) | |
tree | 9f8e330479fcc7374d38591b6b5bc9414721831e /libempathy | |
parent | a26b2e0ceff25839270eb5e4b7bfea58ee13ca6f (diff) | |
download | gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.tar gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.tar.gz gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.tar.bz2 gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.tar.lz gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.tar.xz gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.tar.zst gsoc2013-empathy-7b79bb85f4ff7693ba24c8a94cdcfd9889b567bd.zip |
use tpf_persona_dup_for_contact() instead of lookup_by_contact()
No need to iterate over all the individuals any more.
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-utils.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 5730ed555..62c654428 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -1211,17 +1211,24 @@ empathy_create_individual_from_tp_contact (TpContact *contact) FolksIndividual * empathy_ensure_individual_from_tp_contact (TpContact *contact) { - EmpathyIndividualManager *mgr; + TpfPersona *persona; FolksIndividual *individual; - mgr = empathy_individual_manager_dup_singleton (); - individual = empathy_individual_manager_lookup_by_contact (mgr, contact); + persona = tpf_persona_dup_for_contact (contact); + if (persona == NULL) + { + DEBUG ("Failed to get a persona for %s", + tp_contact_get_identifier (contact)); + return NULL; + } + + individual = folks_persona_get_individual (FOLKS_PERSONA (persona)); if (individual != NULL) g_object_ref (individual); else - individual = empathy_create_individual_from_tp_contact (contact); + individual = create_individual_from_persona (FOLKS_PERSONA (persona)); - g_object_unref (mgr); + g_object_unref (persona); return individual; } |