changeset 28823:16dfa8df7dd1

Call purple_xfer_cancel_local instead of purple_xfer_request_denied when a file send is cancelled due to invalid files or the user cancelling the file selection dialog. I think this makes more sense, since there is no request to deny. It fixes a crash on exit with Bonjour where it attempts to cancel a non-existent PurpleXfer since it doesn't expect request-denied to be called for a send, and holds on to the pointer after it's destroyed. I think this may have affected some other prpls like the Telepathy ones, too.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 23 Dec 2009 06:23:24 +0000
parents df5808d7e669
children 5259ca10b641
files ChangeLog.API libpurple/ft.c
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Wed Dec 23 05:57:45 2009 +0000
+++ b/ChangeLog.API	Wed Dec 23 06:23:24 2009 +0000
@@ -1,6 +1,12 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.6.5 (??/??/20??):
+	libpurple:
+		Changed:
+		* purple_xfer_cancel_local is now called instead of
+		  purple_xfer_request_denied if an error is found when selecting
+		  a file to send. Request denied is still used when a receive
+		  request is not allowed.
 
 version 2.6.4 (11/29/2009):
 	No changes
--- a/libpurple/ft.c	Wed Dec 23 05:57:45 2009 +0000
+++ b/libpurple/ft.c	Wed Dec 23 06:23:24 2009 +0000
@@ -312,7 +312,7 @@
 		}
 		else {
 			purple_xfer_show_file_error(xfer, filename);
-			purple_xfer_request_denied(xfer);
+			purple_xfer_cancel_local(xfer);
 		}
 	}
 	else if ((type == PURPLE_XFER_SEND) && (st.st_size == 0)) {
@@ -320,7 +320,7 @@
 		purple_notify_error(NULL, NULL,
 						  _("Cannot send a file of 0 bytes."), NULL);
 
-		purple_xfer_request_denied(xfer);
+		purple_xfer_cancel_local(xfer);
 	}
 	else if ((type == PURPLE_XFER_SEND) && S_ISDIR(st.st_mode)) {
 		/*
@@ -329,7 +329,7 @@
 		purple_notify_error(NULL, NULL,
 						  _("Cannot send a directory."), NULL);
 
-		purple_xfer_request_denied(xfer);
+		purple_xfer_cancel_local(xfer);
 	}
 	else if ((type == PURPLE_XFER_RECEIVE) && S_ISDIR(st.st_mode)) {
 		char *msg, *utf8;
@@ -371,7 +371,10 @@
 	PurpleXfer *xfer = (PurpleXfer *)user_data;
 
 	purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
-	purple_xfer_request_denied(xfer);
+	if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND)
+		purple_xfer_cancel_local(xfer);
+	else
+		purple_xfer_request_denied(xfer);
 	purple_xfer_unref(xfer);
 }