changeset 11264:74b003b1ba8d

[gaim-migrate @ 13445] Show server aliases in conversation tabs again. Also changed gaim_buddy_get_alias to return the contact alias, if set. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 15 Aug 2005 03:50:11 +0000
parents 14a166f01a8e
children adf36001267b
files src/blist.c src/conversation.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Mon Aug 15 03:23:55 2005 +0000
+++ b/src/blist.c	Mon Aug 15 03:50:11 2005 +0000
@@ -1929,6 +1929,8 @@
 
 const char *gaim_buddy_get_alias(GaimBuddy *buddy)
 {
+	GaimContact *c;
+
 	g_return_val_if_fail(buddy != NULL, NULL);
 
 	/* Search for an alias for the buddy. In order of precedence: */
@@ -1940,6 +1942,11 @@
 	if ((buddy->server_alias) && (*buddy->server_alias))
 		return buddy->server_alias;
 
+	/* The contact alias */
+	c = gaim_buddy_get_contact(buddy);
+	if ((c != NULL) && (c->alias != NULL))
+		return c->alias;
+
 	/* The buddy's user name (i.e. no alias) */
 	return buddy->name;
 }
--- a/src/conversation.c	Mon Aug 15 03:23:55 2005 +0000
+++ b/src/conversation.c	Mon Aug 15 03:50:11 2005 +0000
@@ -1070,7 +1070,7 @@
 
 	if(gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
 		if(account && ((b = gaim_find_buddy(account, name)) != NULL))
-			text = gaim_buddy_get_local_alias(b);
+			text = gaim_buddy_get_alias(b);
 	} else if(gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) {
 		if(account && ((chat = gaim_blist_find_chat(account, name)) != NULL))
 			text = chat->alias;