propagate from branch 'im.pidgin.pidgin' (head 69e7d194a3dbab438652aa4a0b49af3a545d0387) cpw.qulogic.msnp16

Mon, 14 Dec 2009 07:11:03 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 14 Dec 2009 07:11:03 +0000
branch
cpw.qulogic.msnp16
changeset 29438
317147e728dc
parent 29437
034f5db23ca7 (current diff)
parent 29136
69e7d194a3db (diff)
child 29439
38c32318156c

propagate from branch 'im.pidgin.pidgin' (head 69e7d194a3dbab438652aa4a0b49af3a545d0387)
to branch 'im.pidgin.cpw.qulogic.msnp16' (head 034f5db23ca7c065e20d007ce8436987c1402753)

--- a/ChangeLog	Mon Dec 14 03:26:44 2009 +0000
+++ b/ChangeLog	Mon Dec 14 07:11:03 2009 +0000
@@ -8,6 +8,12 @@
 	* Messages from some mobile clients are no longer displayed as
 	  Chinese characters (broken in 2.6.4)
 
+	MSN:
+	* File transfer requests will no longer cause a crash if you delete the file
+	  before the other side accepts.
+	* Recieved files will no longer hold an extra lock after completion, meaning
+	  they can be moved or deleted without complaints from your OS.
+
 	XMPP:
 	* Added support for the SCRAM-SHA-1 SASL mechanism.  This is only
 	  available when built without Cyrus SASL support.
--- a/libpurple/protocols/msn/slp.c	Mon Dec 14 03:26:44 2009 +0000
+++ b/libpurple/protocols/msn/slp.c	Mon Dec 14 07:11:03 2009 +0000
@@ -96,8 +96,6 @@
 
 	g_free(content);
 	msn_slplink_send_queued_slpmsgs(slpcall->slplink);
-
-	purple_xfer_start(xfer, -1, NULL, 0);
 }
 
 void
@@ -128,7 +126,10 @@
 			g_free(content);
 			msn_slplink_send_queued_slpmsgs(slpcall->slplink);
 
-			msn_slpcall_destroy(slpcall);
+			if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND)
+				slpcall->wasted = TRUE;
+			else
+				msn_slpcall_destroy(slpcall);
 		}
 	}
 }
--- a/libpurple/protocols/msn/slplink.c	Mon Dec 14 03:26:44 2009 +0000
+++ b/libpurple/protocols/msn/slplink.c	Mon Dec 14 07:11:03 2009 +0000
@@ -454,20 +454,22 @@
 send_file_cb(MsnSlpCall *slpcall)
 {
 	MsnSlpMessage *slpmsg;
-	struct stat st;
 	PurpleXfer *xfer;
 
+	xfer = (PurpleXfer *)slpcall->xfer;
+	purple_xfer_ref(xfer);
+	purple_xfer_start(xfer, -1, NULL, 0);
+	if (purple_xfer_get_status(xfer) != PURPLE_XFER_STATUS_STARTED) {
+		purple_xfer_unref(xfer);
+		return;
+	}
+	purple_xfer_unref(xfer);
+
 	slpmsg = msn_slpmsg_new(slpcall->slplink);
 	slpmsg->slpcall = slpcall;
 	slpmsg->flags = 0x1000030;
 	slpmsg->info = "SLP FILE";
-
-	xfer = (PurpleXfer *)slpcall->xfer;
-	purple_xfer_start(slpcall->xfer, -1, NULL, 0);
-	if (g_stat(purple_xfer_get_local_filename(xfer), &st) == 0)
-		slpmsg->size = st.st_size;
-	else if (purple_xfer_get_size(xfer))
-		slpmsg->size = purple_xfer_get_size(xfer);
+	slpmsg->size = purple_xfer_get_size(xfer);
 
 	msn_slplink_send_slpmsg(slpcall->slplink, slpmsg);
 }
@@ -620,29 +622,37 @@
 
 		slpcall = msn_slp_process_msg(slplink, slpmsg);
 
-		if (slpmsg->flags == 0x100)
-		{
-			MsnDirectConn *directconn;
+		if (slpcall == NULL) {
+			msn_slpmsg_destroy(slpmsg);
+			return;
+		}
 
-			directconn = slplink->directconn;
+		if (!slpcall->wasted) {
+			if (slpmsg->flags == 0x100)
+			{
+				MsnDirectConn *directconn;
+
+				directconn = slplink->directconn;
 #if 0
-			if (!directconn->acked)
-				msn_directconn_send_handshake(directconn);
+				if (!directconn->acked)
+					msn_directconn_send_handshake(directconn);
 #endif
-		}
-		else if (slpmsg->flags == 0x00 || slpmsg->flags == 0x1000000 ||  
-		         slpmsg->flags == 0x20 || slpmsg->flags == 0x1000020 ||  
-		         slpmsg->flags == 0x1000030)
-		{
-			/* Release all the messages and send the ACK */
+			}
+			else if (slpmsg->flags == 0x00 || slpmsg->flags == 0x1000000 ||  
+			         slpmsg->flags == 0x20 || slpmsg->flags == 0x1000020 ||  
+			         slpmsg->flags == 0x1000030)
+			{
+				/* Release all the messages and send the ACK */
 
-			msn_slplink_send_ack(slplink, msg);
-			msn_slplink_send_queued_slpmsgs(slplink);
+				msn_slplink_send_ack(slplink, msg);
+				msn_slplink_send_queued_slpmsgs(slplink);
+			}
+
 		}
 
 		msn_slpmsg_destroy(slpmsg);
 
-		if (slpcall != NULL && slpcall->wasted)
+		if (slpcall->wasted)
 			msn_slpcall_destroy(slpcall);
 	}
 }

mercurial