diff src/ft.c @ 13598:41e40b323dc3

[gaim-migrate @ 15984] Previously our file transfer dialog showed "time elapsed" as the current time minus the time when the transfer was added to the ft dialog. When sending a file, the transfer is added when you offer the file to the remote user, not when the transfer actually starts. This meant the "time elapsed" was longer than it should have been, which threw off the transfer rate. This should fix that. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 09 Apr 2006 17:38:38 +0000
parents 893ef02b6e28
children 4b6308145fcd
line wrap: on
line diff
--- a/src/ft.c	Sun Apr 09 17:33:25 2006 +0000
+++ b/src/ft.c	Sun Apr 09 17:38:38 2006 +0000
@@ -909,6 +909,8 @@
 
 	xfer->watcher = gaim_input_add(xfer->fd, cond, transfer_cb, xfer);
 
+	xfer->start_time = time(NULL);
+
 	if (xfer->ops.start != NULL)
 		xfer->ops.start(xfer);
 }
@@ -977,6 +979,7 @@
 		return;
 	}
 
+	xfer->end_time = time(NULL);
 	if (xfer->ops.end != NULL)
 		xfer->ops.end(xfer);
 
@@ -1018,6 +1021,7 @@
 	g_return_if_fail(xfer != NULL);
 
 	gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_LOCAL);
+	xfer->end_time = time(NULL);
 
 	if (gaim_xfer_get_filename(xfer) != NULL)
 	{
@@ -1077,6 +1081,7 @@
 
 	gaim_request_close_with_handle(xfer);
 	gaim_xfer_set_status(xfer, GAIM_XFER_STATUS_CANCEL_REMOTE);
+	xfer->end_time = time(NULL);
 
 	account = gaim_xfer_get_account(xfer);
 	buddy = gaim_find_buddy(account, xfer->who);