diff src/conversation.c @ 11478:67abb500f600

[gaim-migrate @ 13720] Room join notices (for the user's account) were showing (null) when the user didn't have an account alias set. It's fixed now. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 09 Sep 2005 17:35:43 +0000
parents c3cb62d33f53
children c80edbd8961a
line wrap: on
line diff
--- a/src/conversation.c	Fri Sep 09 12:34:27 2005 +0000
+++ b/src/conversation.c	Fri Sep 09 17:35:43 2005 +0000
@@ -1985,7 +1985,6 @@
 
 		if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
 			char *tmp;
-			GaimBuddy *buddy;
 
 			if (prpl_info->options & OPT_PROTO_USE_DISPLAY_NAME_FOR_ME_IN_CHATS)
 				tmp = g_strdup(gaim_normalize(conv->account, gc->display_name));
@@ -1993,10 +1992,17 @@
 				tmp = g_strdup(gaim_normalize(conv->account, conv->account->username));
 
 			if (!strcmp(tmp, gaim_normalize(conv->account, user))) {
-				alias = gaim_account_get_alias(conv->account);
-				if (alias == NULL)
-					alias = gaim_connection_get_display_name(gc);
+				const char *alias2 = gaim_account_get_alias(conv->account);
+				if (alias2 != NULL)
+					alias = alias2;
+				else
+				{
+					const char *display_name = gaim_connection_get_display_name(gc);
+					if (display_name != NULL)
+						alias = display_name;
+				}
 			} else {
+				GaimBuddy *buddy;
 				if ((buddy = gaim_find_buddy(gc->account, user)) != NULL)
 					alias = gaim_buddy_get_contact_alias(buddy);
 			}