pidgin: f9196b67: Send a 603 Decline for any SLP invite th...

qulogic at pidgin.im qulogic at pidgin.im
Mon Aug 10 00:45:37 EDT 2009


-----------------------------------------------------------------
Revision: f9196b6751b2bc98317447a8ca0d0ab0d8cde49d
Ancestor: 9705e1920ecbaa8827ea0cb054fa03be736847c0
Author: qulogic at pidgin.im
Date: 2009-08-10T04:25:30
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f9196b6751b2bc98317447a8ca0d0ab0d8cde49d

Modified files:
        libpurple/protocols/msn/slp.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	f9d7178a5c93092b7eab1a96f836bdcd21598d84
+++ libpurple/protocols/msn/slp.c	ce3bc56388fb29196c5d12dae58cb875d2944ee5
@@ -244,6 +244,8 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 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 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 		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 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 
 			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 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 				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 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 				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


More information about the Commits mailing list