diff libpurple/protocols/msn/slp.c @ 27869:00836f1fde84

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.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 10 Aug 2009 04:25:30 +0000
parents 769142e728ec
children db99cde1845c
line wrap: on
line diff
--- 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