changeset 22618:cdc9bb97a88a

merge of '9f17f49ab8d29559a62b77fe6aa5bdefdb6dedfc' and 'fb7362349032daa9e78aaa032f3eb1f0d660bc91'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 09 Apr 2008 19:07:27 +0000
parents 1f16cb128a3a (current diff) bcc355f38ba4 (diff)
children 2804e45e77f6
files
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntft.c	Tue Apr 08 17:36:39 2008 +0000
+++ b/finch/gntft.c	Wed Apr 09 19:07:27 2008 +0000
@@ -403,6 +403,7 @@
 	double kbps = 0.0;
 	time_t elapsed, now;
 	char *kbsec;
+	gboolean send;
 
 	if ((now = purple_xfer_get_end_time(xfer)) == 0)
 		now = time(NULL);
@@ -429,6 +430,7 @@
 	}
 	data->last_updated_time = current_time;
 
+	send = (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND);
 	size_str      = purple_str_size_to_units(purple_xfer_get_size(xfer));
 	remaining_str = purple_str_size_to_units(purple_xfer_get_bytes_remaining(xfer));
 	kbsec = g_strdup_printf(_("%.2f KiB/s"), kbps);
@@ -442,14 +444,17 @@
 	g_free(remaining_str);
 	g_free(kbsec);
 	if (purple_xfer_is_completed(xfer)) {
-		char *msg = g_strdup_printf(_("The file was saved as %s."), purple_xfer_get_local_filename(xfer));
-		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_STATUS, _("Finished"));
+		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_STATUS, send ? _("Sent") : _("Received"));
 		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_REMAINING, _("Finished"));
-		purple_xfer_conversation_write(xfer, msg, FALSE);
-		g_free(msg);
+		if (!send) {
+			char *msg = g_strdup_printf(_("The file was saved as %s."), purple_xfer_get_local_filename(xfer));
+			purple_xfer_conversation_write(xfer, msg, FALSE);
+			g_free(msg);
+		}
 		data->notified = TRUE;
 	} else {
-		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_STATUS, _("Transferring"));
+		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_STATUS,
+				send ? _("Sending") : _("Receiving"));
 	}
 
 	update_title_progress();