aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kaser <f.kaser@gmx.net>2010-03-28 18:28:31 +0800
committerFelix Kaser <f.kaser@gmx.net>2010-03-29 22:35:07 +0800
commit4717ca516f32e001c8888de619ea6624ef074dae (patch)
tree3f44ded5d94d000e641bc104bdc3b3b0b3606048
parentd0c2fc30cafbc9e1f2066bff136f0d19074268ee (diff)
downloadgsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.tar
gsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.tar.gz
gsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.tar.bz2
gsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.tar.lz
gsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.tar.xz
gsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.tar.zst
gsoc2013-empathy-4717ca516f32e001c8888de619ea6624ef074dae.zip
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
-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