comparison libpurple/protocols/msn/switchboard.c @ 23503:165546763e3a

On MSN, only notify the user of a Nudge when the ID of the datacast message is '1'. References #3939.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 23 Jun 2008 01:14:02 +0000
parents 455a8264e06e
children 5c95339855b2
comparison
equal deleted inserted replaced
23502:03ade2360ba6 23503:165546763e3a
958 clientcaps = msn_message_get_hashtable_from_body(msg); 958 clientcaps = msn_message_get_hashtable_from_body(msg);
959 #endif 959 #endif
960 } 960 }
961 961
962 static void 962 static void
963 nudge_msg(MsnCmdProc *cmdproc, MsnMessage *msg) 963 datacast_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
964 { 964 {
965 MsnSwitchBoard *swboard; 965 GHashTable *body;
966 PurpleAccount *account; 966 const char *id;
967 const char *user; 967 body = msn_message_get_hashtable_from_body(msg);
968 968
969 swboard = cmdproc->data; 969 id = g_hash_table_lookup(body, "ID");
970 account = cmdproc->session->account; 970
971 user = msg->remote_user; 971 if (!strcmp(id, "1")) {
972 972 /* Nudge */
973 serv_got_attention(account->gc, user, MSN_NUDGE); 973 MsnSwitchBoard *swboard;
974 PurpleAccount *account;
975 const char *user;
976
977 swboard = cmdproc->data;
978 account = cmdproc->session->account;
979 user = msg->remote_user;
980
981 serv_got_attention(account->gc, user, MSN_NUDGE);
982
983 } else if (!strcmp(id, "2")) {
984 /* Wink */
985
986 } else if (!strcmp(id, "3")) {
987 /* Voiceclip */
988
989 } else if (!strcmp(id, "4")) {
990 /* Action */
991
992 } else {
993 purple_debug_warning("msn", "Got unknown datacast with ID %s.\n", id);
994 }
995
996 g_hash_table_destroy(body);
974 } 997 }
975 998
976 /************************************************************************** 999 /**************************************************************************
977 * Connect stuff 1000 * Connect stuff
978 **************************************************************************/ 1001 **************************************************************************/
1307 msn_table_add_msg_type(cbs_table, "text/x-mms-emoticon", 1330 msn_table_add_msg_type(cbs_table, "text/x-mms-emoticon",
1308 msn_emoticon_msg); 1331 msn_emoticon_msg);
1309 msn_table_add_msg_type(cbs_table, "text/x-mms-animemoticon", 1332 msn_table_add_msg_type(cbs_table, "text/x-mms-animemoticon",
1310 msn_emoticon_msg); 1333 msn_emoticon_msg);
1311 msn_table_add_msg_type(cbs_table, "text/x-msnmsgr-datacast", 1334 msn_table_add_msg_type(cbs_table, "text/x-msnmsgr-datacast",
1312 nudge_msg); 1335 datacast_msg);
1313 #if 0 1336 #if 0
1314 msn_table_add_msg_type(cbs_table, "text/x-msmmsginvite", 1337 msn_table_add_msg_type(cbs_table, "text/x-msmmsginvite",
1315 msn_invite_msg); 1338 msn_invite_msg);
1316 #endif 1339 #endif
1317 } 1340 }