From 4717ca516f32e001c8888de619ea6624ef074dae Mon Sep 17 00:00:00 2001 From: Felix Kaser Date: Sun, 28 Mar 2010 12:28:31 +0200 Subject: 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libempathy/empathy-contact.c') 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 -- cgit v1.2.3