[empathy] Ensure contacts have a persona set



commit acc539549da986e0cfb4dd29142dcdf34743ce7d
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Mon Aug 2 18:29:40 2010 +0100

    Ensure contacts have a persona set
    
    Ensure that contacts created by empathy_contact_dup_from_folks_individual()
    have a persona set, so that things like custom presence messages in contact
    tooltips work again. This requires that we don't set the alias on the
    contacts during the initial contact population period, or we'll end up with
    duplicates of each contact in the list. Closes: bgo#625828

 libempathy/empathy-contact.c |    3 ++-
 libempathy/empathy-utils.c   |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 5b6e334..df8a1ff 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -849,7 +849,8 @@ empathy_contact_set_persona (EmpathyContact *contact,
   /* Set the persona's alias, since ours could've been set using
    * empathy_contact_set_alias() before we had a persona; this happens when
    * adding a contact. */
-  empathy_contact_set_alias (contact, priv->alias);
+  if (priv->alias != NULL)
+    empathy_contact_set_alias (contact, priv->alias);
 
   /* Set the persona's groups */
   if (priv->groups != NULL)
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 9a5e28c..49df14b 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -615,6 +615,7 @@ empathy_contact_dup_from_folks_individual (FolksIndividual *individual)
 
           tp_contact = tpf_persona_get_contact (persona);
           contact = empathy_contact_dup_from_tp_contact (tp_contact);
+          empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
         }
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]