# HG changeset patch # User Elliott Sales de Andrade # Date 1214183642 0 # Node ID 165546763e3a4d11384fa4565b970fe2809e6133 # Parent 03ade2360ba6975a1dc4835c5fa91f6767b387c3 On MSN, only notify the user of a Nudge when the ID of the datacast message is '1'. References #3939. diff -r 03ade2360ba6 -r 165546763e3a libpurple/protocols/msn/switchboard.c --- a/libpurple/protocols/msn/switchboard.c Mon Jun 23 00:54:05 2008 +0000 +++ b/libpurple/protocols/msn/switchboard.c Mon Jun 23 01:14:02 2008 +0000 @@ -960,17 +960,40 @@ } static void -nudge_msg(MsnCmdProc *cmdproc, MsnMessage *msg) +datacast_msg(MsnCmdProc *cmdproc, MsnMessage *msg) { - MsnSwitchBoard *swboard; - PurpleAccount *account; - const char *user; + GHashTable *body; + const char *id; + body = msn_message_get_hashtable_from_body(msg); + + id = g_hash_table_lookup(body, "ID"); + + if (!strcmp(id, "1")) { + /* Nudge */ + MsnSwitchBoard *swboard; + PurpleAccount *account; + const char *user; - swboard = cmdproc->data; - account = cmdproc->session->account; - user = msg->remote_user; + swboard = cmdproc->data; + account = cmdproc->session->account; + user = msg->remote_user; + + serv_got_attention(account->gc, user, MSN_NUDGE); + + } else if (!strcmp(id, "2")) { + /* Wink */ - serv_got_attention(account->gc, user, MSN_NUDGE); + } else if (!strcmp(id, "3")) { + /* Voiceclip */ + + } else if (!strcmp(id, "4")) { + /* Action */ + + } else { + purple_debug_warning("msn", "Got unknown datacast with ID %s.\n", id); + } + + g_hash_table_destroy(body); } /************************************************************************** @@ -1309,7 +1332,7 @@ msn_table_add_msg_type(cbs_table, "text/x-mms-animemoticon", msn_emoticon_msg); msn_table_add_msg_type(cbs_table, "text/x-msnmsgr-datacast", - nudge_msg); + datacast_msg); #if 0 msn_table_add_msg_type(cbs_table, "text/x-msmmsginvite", msn_invite_msg);