[empathy] fallback to JID if alias is empty



commit 4717ca516f32e001c8888de619ea6624ef074dae
Author: Felix Kaser <f kaser gmx net>
Date:   Sun Mar 28 12:28:31 2010 +0200

    fallback to JID if alias is empty
    
    if the alias is empty, contact_get_name should fallback to the jabber id. this fixes bug #614162

 libempathy/empathy-contact.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index feba1c0..df7d04e 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -513,18 +513,21 @@ const gchar *
 empathy_contact_get_name (EmpathyContact *contact)
 {
   EmpathyContactPriv *priv;
+  const gchar        *alias;
 
   g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
 
   priv = GET_PRIV (contact);
 
   if (priv->tp_contact != NULL)
-    return tp_contact_get_alias (priv->tp_contact);
-
-  if (EMP_STR_EMPTY (priv->name))
-      return empathy_contact_get_id (contact);
+    alias = tp_contact_get_alias (priv->tp_contact);
+  else
+    alias = priv->name;
 
-  return priv->name;
+  if (!EMP_STR_EMPTY (alias))
+    return alias;
+  else
+    return empathy_contact_get_id (contact);
 }
 
 void



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