pidgin: b86e5be2: Call purple_xfer_cancel_local instead of...

qulogic at pidgin.im qulogic at pidgin.im
Wed Dec 23 03:47:20 EST 2009


-----------------------------------------------------------------
Revision: b86e5be240d2c52d0ba3da0a5a555ea2cfdc3f9e
Ancestor: 2dbb00f0ef32bda6e230d1a55892975135f76691
Author: qulogic at pidgin.im
Date: 2009-12-23T06:23:24
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b86e5be240d2c52d0ba3da0a5a555ea2cfdc3f9e

Modified files:
        ChangeLog.API libpurple/ft.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- ChangeLog.API	6d02cf5878c64a9500edbd7d0651fc24026d46c0
+++ ChangeLog.API	0ac41de7213da3aa0b141a659c274c9bc08a784f
@@ -1,6 +1,12 @@ version 2.6.5 (??/??/20??):
 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
============================================================
--- libpurple/ft.c	2089138272f391ff74e9485194d4c923cc259b42
+++ libpurple/ft.c	807bdd027a1c6a7c67f680a29d4147981503b588
@@ -312,7 +312,7 @@ purple_xfer_choose_file_ok_cb(void *user
 		}
 		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_xfer_choose_file_ok_cb(void *user
 		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_xfer_choose_file_ok_cb(void *user
 		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 @@ purple_xfer_choose_file_cancel_cb(void *
 	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);
 }
 


More information about the Commits mailing list