diff libgaim/protocols/msn/notification.c @ 14484:1f81919515ae

[gaim-migrate @ 17203] Part of SF Patch #1554627 from Richard Nelson (wabz) "The msn protocol currently calls serv_got_alias on all buddy status changes (as they are NLN commands), resulting in lots of unnecessary blist.xml write schedules. serv_got_alias already checks if the alias has actually changed before printing to the conv. The first hunk in this patch checks it a bit earlier." The second hunk checks in the MSN prpl, which also avoids an extra call to msn_user_set_friendly_name(). committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 09 Sep 2006 20:27:48 +0000
parents 60b1bc8dbf37
children 0aa6adcdd819
line wrap: on
line diff
--- a/libgaim/protocols/msn/notification.c	Sat Sep 09 19:41:34 2006 +0000
+++ b/libgaim/protocols/msn/notification.c	Sat Sep 09 20:27:48 2006 +0000
@@ -664,7 +664,7 @@
 	MsnUser *user;
 	MsnObject *msnobj;
 	int clientid;
-	const char *state, *passport, *friendly;
+	const char *state, *passport, *friendly, *old_friendly;
 
 	session = cmdproc->session;
 	account = session->account;
@@ -676,9 +676,12 @@
 
 	user = msn_userlist_find_user(session->userlist, passport);
 
-	serv_got_alias(gc, passport, friendly);
-
-	msn_user_set_friendly_name(user, friendly);
+	old_friendly = msn_user_get_friendly_name(user);
+	if (old_friendly && strcmp(old_friendly, friendly))
+	{
+		serv_got_alias(gc, passport, friendly);
+		msn_user_set_friendly_name(user, friendly);
+	}
 
 	if (session->protocol_ver >= 9)
 	{