aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index feba1c0b7..df7d04eca 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