diff src/ft.c @ 8585:e4087b5c0627

[gaim-migrate @ 9335] Patch from Pekka Riikonen to allow a prpl to accept a file transfer without choosing the save filename, and then to later complete this selection. This also provides some API extension to allow a prpl to handle its own connection setups and a posteriori add the connection to gaim's file transfer list. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Mon, 05 Apr 2004 20:15:29 +0000
parents ffa642240fc1
children 3ed6001d5de8
line wrap: on
line diff
--- a/src/ft.c	Mon Apr 05 17:33:34 2004 +0000
+++ b/src/ft.c	Mon Apr 05 20:15:29 2004 +0000
@@ -123,12 +123,17 @@
 {
 	GaimXferType type;
 
-	if (xfer == NULL || filename == NULL) {
+	if (xfer == NULL)
+		return;
+
+	type = gaim_xfer_get_type(xfer);
+
+	if (!filename && type == GAIM_XFER_RECEIVE) {
+		xfer->status = GAIM_XFER_STATUS_ACCEPTED;
+		xfer->ops.init(xfer);
 		return;
 	}
 
-	type = gaim_xfer_get_type(xfer);
-
 	if (type == GAIM_XFER_SEND) {
 		struct stat sb;
 
@@ -324,7 +329,6 @@
 
 	if (ui_ops != NULL && ui_ops->update_progress != NULL)
 		ui_ops->update_progress(xfer, gaim_xfer_get_progress(xfer));
-
 }
 
 void
@@ -672,6 +676,19 @@
 }
 
 void
+gaim_xfer_add(GaimXfer *xfer)
+{
+	GaimXferUiOps *ui_ops;
+
+	g_return_if_fail(xfer != NULL);
+
+	ui_ops = gaim_xfer_get_ui_ops(xfer);
+
+	if (ui_ops != NULL && ui_ops->add_xfer != NULL)
+		ui_ops->add_xfer(xfer);
+}
+
+void
 gaim_xfer_cancel_local(GaimXfer *xfer)
 {
 	GaimXferUiOps *ui_ops;
@@ -775,6 +792,19 @@
 	g_free(title);
 }
 
+void
+gaim_xfer_update_progress(GaimXfer *xfer)
+{
+	GaimXferUiOps *ui_ops;
+
+	g_return_if_fail(xfer != NULL);
+
+	ui_ops = gaim_xfer_get_ui_ops(xfer);
+	if (ui_ops != NULL && ui_ops->update_progress != NULL)
+		ui_ops->update_progress(xfer, gaim_xfer_get_progress(xfer));
+}
+
+
 /**************************************************************************
  * File Transfer Subsystem API
  **************************************************************************/
@@ -790,4 +820,3 @@
 {
 	return xfer_ui_ops;
 }
-