# HG changeset patch # User Elliott Sales de Andrade # Date 1249877800 0 # Node ID 9262c8f306a6febf0f94fecee1f7718af655c082 # Parent 2f7386e1c5d1d36f8a518aba0964b646b37933ac Send a cancel message for any unknown text/x-msmsgsinvite requests, so that your buddies won't be wondering why you never answered their invitation. This is used for stuff like Whiteboard and Application Sharing. diff -r 2f7386e1c5d1 -r 9262c8f306a6 libpurple/protocols/msn/msg.c --- a/libpurple/protocols/msn/msg.c Sun Aug 09 07:29:01 2009 +0000 +++ b/libpurple/protocols/msn/msg.c Mon Aug 10 04:16:40 2009 +0000 @@ -1102,6 +1102,7 @@ { GHashTable *body; const gchar *guid; + gboolean accepted = FALSE; g_return_if_fail(cmdproc != NULL); g_return_if_fail(msg != NULL); @@ -1129,6 +1130,9 @@ } else purple_debug_warning("msn", "Invite msg missing " "Application-GUID.\n"); + + accepted = TRUE; + } else if (!strcmp(guid, "{02D3C01F-BF30-4825-A83A-DE7AF41648AA}")) { purple_debug_info("msn", "Computer call\n"); @@ -1160,6 +1164,30 @@ guid, application ? application : "(null)"); } + if (!accepted) { + const gchar *cookie = g_hash_table_lookup(body, "Invitation-Cookie"); + if (cookie) { + MsnSwitchBoard *swboard = cmdproc->data; + char *text; + MsnMessage *cancel; + + cancel = msn_message_new(MSN_MSG_TEXT); + msn_message_set_content_type(cancel, "text/x-msmsgsinvite"); + msn_message_set_charset(cancel, "UTF-8"); + msn_message_set_flag(cancel, 'U'); + + text = g_strdup_printf("Invitation-Command: CANCEL\r\n" + "Invitation-Cookie: %s\r\n" + "Cancel-Code: REJECT_NOT_INSTALLED\r\n", + cookie); + msn_message_set_bin_data(cancel, text, strlen(text)); + g_free(text); + + msn_switchboard_send_msg(swboard, cancel, TRUE); + msn_message_destroy(cancel); + } + } + g_hash_table_destroy(body); }