comparison 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
comparison
equal deleted inserted replaced
8584:058efd3cb86f 8585:e4087b5c0627
121 void 121 void
122 gaim_xfer_request_accepted(GaimXfer *xfer, const char *filename) 122 gaim_xfer_request_accepted(GaimXfer *xfer, const char *filename)
123 { 123 {
124 GaimXferType type; 124 GaimXferType type;
125 125
126 if (xfer == NULL || filename == NULL) { 126 if (xfer == NULL)
127 return; 127 return;
128 }
129 128
130 type = gaim_xfer_get_type(xfer); 129 type = gaim_xfer_get_type(xfer);
130
131 if (!filename && type == GAIM_XFER_RECEIVE) {
132 xfer->status = GAIM_XFER_STATUS_ACCEPTED;
133 xfer->ops.init(xfer);
134 return;
135 }
131 136
132 if (type == GAIM_XFER_SEND) { 137 if (type == GAIM_XFER_SEND) {
133 struct stat sb; 138 struct stat sb;
134 139
135 /* Check the filename. */ 140 /* Check the filename. */
322 327
323 ui_ops = gaim_xfer_get_ui_ops(xfer); 328 ui_ops = gaim_xfer_get_ui_ops(xfer);
324 329
325 if (ui_ops != NULL && ui_ops->update_progress != NULL) 330 if (ui_ops != NULL && ui_ops->update_progress != NULL)
326 ui_ops->update_progress(xfer, gaim_xfer_get_progress(xfer)); 331 ui_ops->update_progress(xfer, gaim_xfer_get_progress(xfer));
327
328 } 332 }
329 333
330 void 334 void
331 gaim_xfer_set_filename(GaimXfer *xfer, const char *filename) 335 gaim_xfer_set_filename(GaimXfer *xfer, const char *filename)
332 { 336 {
670 674
671 gaim_xfer_unref(xfer); 675 gaim_xfer_unref(xfer);
672 } 676 }
673 677
674 void 678 void
679 gaim_xfer_add(GaimXfer *xfer)
680 {
681 GaimXferUiOps *ui_ops;
682
683 g_return_if_fail(xfer != NULL);
684
685 ui_ops = gaim_xfer_get_ui_ops(xfer);
686
687 if (ui_ops != NULL && ui_ops->add_xfer != NULL)
688 ui_ops->add_xfer(xfer);
689 }
690
691 void
675 gaim_xfer_cancel_local(GaimXfer *xfer) 692 gaim_xfer_cancel_local(GaimXfer *xfer)
676 { 693 {
677 GaimXferUiOps *ui_ops; 694 GaimXferUiOps *ui_ops;
678 695
679 g_return_if_fail(xfer != NULL); 696 g_return_if_fail(xfer != NULL);
773 gaim_notify_error(NULL, NULL, title, msg); 790 gaim_notify_error(NULL, NULL, title, msg);
774 791
775 g_free(title); 792 g_free(title);
776 } 793 }
777 794
795 void
796 gaim_xfer_update_progress(GaimXfer *xfer)
797 {
798 GaimXferUiOps *ui_ops;
799
800 g_return_if_fail(xfer != NULL);
801
802 ui_ops = gaim_xfer_get_ui_ops(xfer);
803 if (ui_ops != NULL && ui_ops->update_progress != NULL)
804 ui_ops->update_progress(xfer, gaim_xfer_get_progress(xfer));
805 }
806
807
778 /************************************************************************** 808 /**************************************************************************
779 * File Transfer Subsystem API 809 * File Transfer Subsystem API
780 **************************************************************************/ 810 **************************************************************************/
781 811
782 void 812 void
788 GaimXferUiOps * 818 GaimXferUiOps *
789 gaim_xfers_get_ui_ops(void) 819 gaim_xfers_get_ui_ops(void)
790 { 820 {
791 return xfer_ui_ops; 821 return xfer_ui_ops;
792 } 822 }
793