Mercurial > pidgin
diff libpurple/protocols/msnp9/notification.c @ 22259:6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
them
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sun, 03 Feb 2008 17:37:58 +0000 |
parents | d5e8ee52ddcc |
children | 713cd3a2d1cd |
line wrap: on
line diff
--- a/libpurple/protocols/msnp9/notification.c Sun Feb 03 17:33:02 2008 +0000 +++ b/libpurple/protocols/msnp9/notification.c Sun Feb 03 17:37:58 2008 +0000 @@ -840,6 +840,38 @@ } 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_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);