changeset 9771:9812dde4323e

[gaim-migrate @ 10639] Some good file transfer tweaks from Dave West committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 18 Aug 2004 04:13:35 +0000
parents 41f302d41839
children 5f7c81eeebd2
files ChangeLog src/ft.c src/protocols/oscar/oscar.c
diffstat 3 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 17 02:52:13 2004 +0000
+++ b/ChangeLog	Wed Aug 18 04:13:35 2004 +0000
@@ -4,6 +4,7 @@
 	New Features:
 	* Topics in the conversation window (not the topic field at the
 	  top) with urls will now have those urls linkified (Stu Tomlinson)
+
 	Bug Fixes:
 	* Joining a Jabber chat no longer causes a crash (Stu Tomlinson)
 	* Selecting a buddy icon for a brand new account no longer
@@ -15,6 +16,7 @@
 	  (Felipe Contreras)
 	* The chat invite button has a correct label (Stu Tomlinson)
 	* The system log should leak fewer file descriptors now (Ka-Hing Cheung)
+	* Better file transfer cancel messages for AIM (Dave West)
 
 version 0.81 (08/05/2004):
 	New Features:
--- a/src/ft.c	Tue Aug 17 02:52:13 2004 +0000
+++ b/src/ft.c	Wed Aug 18 04:13:35 2004 +0000
@@ -121,6 +121,11 @@
 			gaim_xfer_request_accepted(xfer, filename);
 		}
 		else {
+			/*
+			 * XXX - I believe this will never happen when using
+			 * gaim_request_file() because filename is always an
+			 * existing file.  Someone verify that.  --Mark
+			 */
 			gaim_notify_error(NULL, NULL,
 							  _("That file does not exist."), NULL);
 
@@ -137,7 +142,9 @@
 	}
 	else {
 		if (S_ISDIR(st.st_mode)) {
-			/* XXX */
+			/*
+			 * XXX - Sending a directory should be valid for some protocols.
+			 */
 			gaim_xfer_request_denied(xfer);
 		}
 		else if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) {
@@ -876,9 +883,17 @@
 gaim_xfer_cancel_remote(GaimXfer *xfer)
 {
 	GaimXferUiOps *ui_ops;
+	gchar *msg;
 
 	g_return_if_fail(xfer != NULL);
 
+	gaim_request_close_with_handle(xfer);
+
+	msg = g_strdup_printf(_("%s canceled the transfer of %s"),
+	xfer->who, gaim_xfer_get_filename(xfer));
+	gaim_xfer_error(gaim_xfer_get_type(xfer), xfer->who, msg);
+	g_free(msg);
+
 	gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_REMOTE);
 
 	if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND)
--- a/src/protocols/oscar/oscar.c	Tue Aug 17 02:52:13 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Aug 18 04:13:35 2004 +0000
@@ -1808,7 +1808,8 @@
 
 	gaim_debug_info("oscar", "AAA - in oscar_xfer_cancel_recv\n");
 
-	aim_im_sendch2_sendfile_cancel(oft_info->sess, oft_info);
+	if (gaim_xfer_get_status(xfer) != GAIM_XFER_STATUS_CANCEL_REMOTE)
+		aim_im_sendch2_sendfile_cancel(oft_info->sess, oft_info);
 
 	aim_conn_kill(oft_info->sess, &oft_info->conn);
 	aim_oft_destroyinfo(oft_info);
@@ -1877,7 +1878,8 @@
 
 	gaim_debug_info("oscar", "AAA - in oscar_xfer_cancel_send\n");
 
-	aim_im_sendch2_sendfile_cancel(oft_info->sess, oft_info);
+	if (gaim_xfer_get_status(xfer) != GAIM_XFER_STATUS_CANCEL_REMOTE)
+		aim_im_sendch2_sendfile_cancel(oft_info->sess, oft_info);
 
 	aim_conn_kill(oft_info->sess, &oft_info->conn);
 	aim_oft_destroyinfo(oft_info);