im.pidgin.pidgin: 51b239b14b22e651848b193b8bad9c1ec5cc0afa

nosnilmot at pidgin.im nosnilmot at pidgin.im
Sun Feb 3 12:40:38 EST 2008


-----------------------------------------------------------------
Revision: 51b239b14b22e651848b193b8bad9c1ec5cc0afa
Ancestor: d36c1d52c48fe90a9321222eca0615dbf4d0ad77
Author: nosnilmot at pidgin.im
Date: 2008-02-03T17:37:58
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/51b239b14b22e651848b193b8bad9c1ec5cc0afa

Modified files:
        libpurple/protocols/msn/msn.c
        libpurple/protocols/msnp9/msn.c
        libpurple/protocols/msnp9/notification.c
        libpurple/protocols/msnp9/sync.c

ChangeLog: 

Display buddies' phone numbers in the tooltip for MSN buddies if we have
them

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	79a0bf93432869bfc566e34e87b9ada3f0b4a80a
+++ libpurple/protocols/msn/msn.c	71e1d8ffc4ae2d0cfd3016632bb534b8ef18ecd9
@@ -655,8 +655,22 @@ msn_tooltip_text(PurpleBuddy *buddy, Pur
 	 */
 	if (full && user)
 	{
+		const char *phone;
+
 		purple_notify_user_info_add_pair(user_info, _("Blocked"),
 									   ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No")));
+
+		phone = msn_user_get_home_phone(user);
+		if (phone != NULL)
+			purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), phone);
+
+		phone = msn_user_get_work_phone(user);
+		if (phone != NULL)
+			purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), phone);
+
+		phone = msn_user_get_mobile_phone(user);
+		if (phone != NULL)
+			purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone);
 	}
 }
 
============================================================
--- libpurple/protocols/msnp9/msn.c	0cb785cb825d6db9977a1b85b7ad489a49e195e2
+++ libpurple/protocols/msnp9/msn.c	1daf6dbd4257855685b39a4c731478e11f74a869
@@ -557,8 +557,22 @@ msn_tooltip_text(PurpleBuddy *buddy, Pur
 	 * you, which is the important information that this is trying to convey. */
 	if (full && user)
 	{
+		const char *phone;
+
 		purple_notify_user_info_add_pair(user_info, _("Blocked"),
 									   ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No")));
+
+		phone = msn_user_get_home_phone(user);
+		if (phone != NULL)
+			purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), phone);
+
+		phone = msn_user_get_work_phone(user);
+		if (phone != NULL)
+			purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), phone);
+
+		phone = msn_user_get_mobile_phone(user);
+		if (phone != NULL)
+			purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone);
 	}
 }
 
============================================================
--- libpurple/protocols/msnp9/notification.c	f2f678f78f86b80a2135674304ab7f905968dae5
+++ libpurple/protocols/msnp9/notification.c	c3dcbd019d45ecc26bdb68e5b8da748936ff9e98
@@ -840,6 +840,38 @@ static void
 }
 
 static void
+bpr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
+{
+	const char *type, *value, *passport;
+	MsnUser *user;
+
+	passport = cmd->params[1];
+	user = msn_userlist_find_user(cmdproc->session->userlist, passport);
+
+	g_return_if_fail(user != NULL);
+
+	type     = cmd->params[2];
+	value    = cmd->params[3];
+
+	if (value)
+	{
+		if (!strcmp(type, "MOB"))
+		{
+			if (!strcmp(value, "Y"))
+				user->mobile = TRUE;
+			else if (!strcmp(value, "N"))
+				user->mobile = FALSE;
+		}
+		else if (!strcmp(type, "PHH"))
+			msn_user_set_home_phone(user, purple_url_decode(value));
+		else if (!strcmp(type, "PHW"))
+			msn_user_set_work_phone(user, purple_url_decode(value));
+		else if (!strcmp(type, "PHM"))
+			msn_user_set_mobile_phone(user, purple_url_decode(value));
+	}
+}
+
+static void
 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
 	MsnSession *session;
@@ -1435,6 +1467,7 @@ msn_notification_init(void)
 	msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd);
 	msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd);
 	msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd);
+	msn_table_add_cmd(cbs_table, NULL, "BPR", bpr_cmd);
 
 	msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd);
 	msn_table_add_cmd(cbs_table, NULL, "REM", rem_cmd);
============================================================
--- libpurple/protocols/msnp9/sync.c	a07f7804d5d27843b891a5064a57f0107a51bfe6
+++ libpurple/protocols/msnp9/sync.c	60641c1af8c34401f9a686046b80491bbb4e311c
@@ -206,6 +206,8 @@ bpr_cmd(MsnCmdProc *cmdproc, MsnCommand 
 		{
 			if (!strcmp(value, "Y"))
 				user->mobile = TRUE;
+			else if (!strcmp(value, "N"))
+				user->mobile = FALSE;
 		}
 		else if (!strcmp(type, "PHH"))
 			msn_user_set_home_phone(user, purple_url_decode(value));


More information about the Commits mailing list