pidgin: e661636b: When opening MSN chats, use "Local alias...

qulogic at pidgin.im qulogic at pidgin.im
Fri Aug 8 02:11:25 EDT 2008


-----------------------------------------------------------------
Revision: e661636ba7f9069593cfee6ad1c4f3a7a527118a
Ancestor: 1a8574b1e440cce02e4e9ba89bf94ed58e31d17b
Author: qulogic at pidgin.im
Date: 2008-08-08T05:49:47
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e661636ba7f9069593cfee6ad1c4f3a7a527118a

Modified files:
        libpurple/protocols/msn/msn.c

ChangeLog: 

When opening MSN chats, use "Local alias" in preference to "Display 
name" in preference to "Username" for ourselves.

Fixes #4891.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	92a1df1f9e040e579b45d186952b3a88c2c67bec
+++ libpurple/protocols/msn/msn.c	dc86f99b10df2b1612a0c870abfe92baf34f2d46
@@ -514,6 +514,8 @@ initiate_chat_cb(PurpleBlistNode *node, 
 	MsnSession *session;
 	MsnSwitchBoard *swboard;
 
+	const char *alias;
+
 	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
 
 	buddy = (PurpleBuddy *) node;
@@ -530,8 +532,13 @@ initiate_chat_cb(PurpleBlistNode *node, 
 	swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
 	swboard->flag = MSN_SB_FLAG_IM;
 
+	/* Local alias > Display name > Username */
+	if ((alias = purple_account_get_alias(buddy->account)) == NULL)
+		if ((alias = purple_connection_get_display_name(gc)) == NULL)
+			alias = purple_account_get_username(buddy->account);
+
 	purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv),
-							purple_account_get_username(buddy->account), NULL, PURPLE_CBFLAGS_NONE, TRUE);
+	                          alias, NULL, PURPLE_CBFLAGS_NONE, TRUE);
 }
 
 static void


More information about the Commits mailing list