im.pidgin.pidgin: fb945a0cab270a5eaf15d294b8706714e22742c1

nosnilmot at pidgin.im nosnilmot at pidgin.im
Wed Nov 28 14:20:40 EST 2007


-----------------------------------------------------------------
Revision: fb945a0cab270a5eaf15d294b8706714e22742c1
Ancestor: 41b4d75b70555daf78b3c5701a59453027ca57e7
Author: nosnilmot at pidgin.im
Date: 2007-11-28T19:14:26
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/msnp9/notification.c
        libpurple/protocols/msnp9/session.h
        libpurple/protocols/msnp9/user.c

ChangeLog: 

Fix 2 more issues related to friendly names:
 - Don't try setting any friendly names for unverified passports
 - Don't try setting a friendly name if they are not actually on our friend list

Fixes #4109

-------------- next part --------------
============================================================
--- libpurple/protocols/msnp9/notification.c	83db9e1346bfbee5a95f55cfe10508d78fdac196
+++ libpurple/protocols/msnp9/notification.c	ee83db2707a80aea2a2bfa6453a4a5dba6b2117b
@@ -235,6 +235,8 @@ usr_cmd(MsnCmdProc *cmdproc, MsnCommand 
 		/* OK */
 		const char *friendly = purple_url_decode(cmd->params[3]);
 
+		session->passport_info.verified = atoi(cmd->params[4]);
+
 		purple_connection_set_display_name(gc, friendly);
 
 		msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);
============================================================
--- libpurple/protocols/msnp9/session.h	d5bec9bc0a92062231a3af894739157d9a8766c1
+++ libpurple/protocols/msnp9/session.h	dfa5899b4e3af635d628382342b68851745022d3
@@ -114,7 +114,7 @@ struct _MsnSession
 		char *file;
 		char *client_ip;
 		int client_port;
-
+		int verified;
 	} passport_info;
 };
 
============================================================
--- libpurple/protocols/msnp9/user.c	d5fa240d020a6f90aecb2b07a3bf4ce1a2116e5e
+++ libpurple/protocols/msnp9/user.c	92a67c2d9914c87de46146f76f97a1bd8fed8258
@@ -126,16 +126,20 @@ msn_user_set_friendly_name(MsnUser *user
 msn_user_set_friendly_name(MsnUser *user, const char *name)
 {
 	MsnCmdProc *cmdproc;
+	MsnSession *session;
 	const char *encoded;
 
 	g_return_if_fail(user != NULL);
 
 	encoded = purple_url_encode(name);
+	session = user->userlist->session;
 
-	if (user->friendly_name && strcmp(user->friendly_name, name) && (strlen(encoded) < 387)) {
+	if (user->friendly_name && strcmp(user->friendly_name, name)
+		&& (strlen(encoded) < 387) && session->passport_info.verified &&
+		(user->list_op & MSN_LIST_FL_OP)) {
 		/* copy the new name to the server list, but only when new */
 		/* should we check this more thoroughly? */
-		cmdproc = user->userlist->session->notification->cmdproc;
+		cmdproc = session->notification->cmdproc;
 		msn_cmdproc_send(cmdproc, "REA", "%s %s",
 						 user->passport,
 						 encoded);


More information about the Commits mailing list