changeset 10833:a60704081c3e

[gaim-migrate @ 12503] Fix bug #1016434 - "MSN phone numbers don't appear changed until next logon" committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 16 Apr 2005 18:44:40 +0000
parents 9d288fd77d3b
children 76d85ccf7d90
files src/protocols/msn/notification.c
diffstat 1 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/notification.c	Sat Apr 16 17:35:22 2005 +0000
+++ b/src/protocols/msn/notification.c	Sat Apr 16 18:44:40 2005 +0000
@@ -752,6 +752,37 @@
 }
 
 static void
+prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
+{
+	MsnSession *session = cmdproc->session;
+	const char *type, *value;
+
+	g_return_if_fail(cmd->param_count >= 3);
+
+	type  = cmd->params[2];
+
+	if (cmd->param_count == 4)
+	{
+		value = cmd->params[3];
+		if (!strcmp(type, "PHH"))
+			msn_user_set_home_phone(session->user, gaim_url_decode(value));
+		else if (!strcmp(type, "PHW"))
+			msn_user_set_work_phone(session->user, gaim_url_decode(value));
+		else if (!strcmp(type, "PHM"))
+			msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
+	}
+	else
+	{
+		if (!strcmp(type, "PHH"))
+			msn_user_set_home_phone(session->user, NULL);
+		else if (!strcmp(type, "PHW"))
+			msn_user_set_work_phone(session->user, NULL);
+		else if (!strcmp(type, "PHM"))
+			msn_user_set_mobile_phone(session->user, NULL);
+	}
+}
+
+static void
 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
 	MsnSession *session;
@@ -1347,7 +1378,7 @@
 	msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd);
 	msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd);
 	msn_table_add_cmd(cbs_table, "REA", "REA", rea_cmd);
-	/* msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd); */
+	msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd);
 	/* msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); */
 	msn_table_add_cmd(cbs_table, "BLP", "BLP", NULL);
 	msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd);