# HG changeset patch
# User Elliott Sales de Andrade <qulogic@pidgin.im>
# Date 1249878330 0
# Node ID 00836f1fde84bdefc6b36e4ce7d5e97a9a7bdfc5
# Parent  9262c8f306a6febf0f94fecee1f7718af655c082
Send a 603 Decline for any SLP invite that we do not support, so that your
buddies won't be confused about why you never accepted their invite. This
is used for stuff like games.

diff -r 9262c8f306a6 -r 00836f1fde84 libpurple/protocols/msn/slp.c
--- a/libpurple/protocols/msn/slp.c	Mon Aug 10 04:16:40 2009 +0000
+++ b/libpurple/protocols/msn/slp.c	Mon Aug 10 04:25:30 2009 +0000
@@ -244,6 +244,8 @@
 got_sessionreq(MsnSlpCall *slpcall, const char *branch,
 			   const char *euf_guid, const char *context)
 {
+	gboolean accepted = FALSE;
+
 	if (!strcmp(euf_guid, MSN_OBJ_GUID))
 	{
 		/* Emoticon or UserDisplay */
@@ -314,7 +316,10 @@
 		msn_slpmsg_set_image(slpmsg, img);
 		msn_slplink_queue_slpmsg(slplink, slpmsg);
 		purple_imgstore_unref(img);
+
+		accepted = TRUE;
 	}
+
 	else if (!strcmp(euf_guid, MSN_FT_GUID))
 	{
 		/* File Transfer */
@@ -360,6 +365,9 @@
 
 			purple_xfer_request(xfer);
 		}
+
+		accepted = TRUE;
+
 	} else if (!strcmp(euf_guid, MSN_CAM_REQUEST_GUID)) {
 		purple_debug_info("msn", "Cam request.\n");
 		if (slpcall && slpcall->slplink &&
@@ -382,6 +390,7 @@
 				g_free(buf);
 			}
 		}
+
 	} else if (!strcmp(euf_guid, MSN_CAM_GUID)) {
 		purple_debug_info("msn", "Cam invite.\n");
 		if (slpcall && slpcall->slplink &&
@@ -404,8 +413,16 @@
 				g_free(buf);
 			}
 		}
+
 	} else
 		purple_debug_warning("msn", "SLP SessionReq with unknown EUF-GUID: %s\n", euf_guid);
+
+	if (!accepted) {
+		char *content = g_strdup_printf("SessionID: %lu\r\n\r\n",
+		                                slpcall->session_id);
+		send_decline(slpcall, branch, "application/x-msnmsgr-sessionreqbody", content);
+		g_free(content);
+	}
 }
 
 void