]> git.0d.be Git - empathy.git/commitdiff
fallback to JID if alias is empty
authorFelix Kaser <f.kaser@gmx.net>
Sun, 28 Mar 2010 10:28:31 +0000 (12:28 +0200)
committerFelix Kaser <f.kaser@gmx.net>
Mon, 29 Mar 2010 14:35:07 +0000 (16:35 +0200)
if the alias is empty, contact_get_name should fallback to the jabber id. this fixes bug #614162

libempathy/empathy-contact.c

index feba1c0b72d6f98901a8cdadd17b43b8eb73f431..df7d04ecaf94c30e8f84ee306d3c19a5abeda676 100644 (file)
@@ -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