comparison src/protocols/sametime/sametime.c @ 12143:cbebda5f019c

[gaim-migrate @ 14444] SF Patch #1360399 from Evan Schoenberg (evands) "I discussed this previously with Mark and he said it'd be fine. This factors out the part of the send_file function which creates a new GaimXfer into a separate prpl function, new_xfer. It's called in each of the existing send_file functions. This is needed so that another client (okay, Adium) can get a new outgoing GaimXfer from a prpl without depending upon the specific ft.c logic of send_file; previously I was adding a duplicate method to each prpl and then calling it directly." I fixed a couple small bugs in this. Otherwise, it looks good, and seems like a reasonable libgaim request. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 19 Nov 2005 00:26:12 +0000
parents e09bf5bc81d8
children 9ce0a5f9443b
comparison
equal deleted inserted replaced
12142:0c672be21798 12143:cbebda5f019c
5027 struct mwFileTransfer *ft = xfer->data; 5027 struct mwFileTransfer *ft = xfer->data;
5028 if(ft) mwFileTransfer_cancel(ft); 5028 if(ft) mwFileTransfer_cancel(ft);
5029 } 5029 }
5030 5030
5031 5031
5032 static void mw_prpl_send_file(GaimConnection *gc, 5032 static GaimXfer *mw_prpl_new_xfer(GaimConnect *gc, const char *who) {
5033 const char *who, const char *file) {
5034
5035 GaimAccount *acct; 5033 GaimAccount *acct;
5036 GaimXfer *xfer; 5034 GaimXfer *xfer;
5037 5035
5038 acct = gaim_connection_get_account(gc); 5036 acct = gaim_connection_get_account(gc);
5039 5037
5040 xfer = gaim_xfer_new(acct, GAIM_XFER_SEND, who); 5038 xfer = gaim_xfer_new(acct, GAIM_XFER_SEND, who);
5041 gaim_xfer_set_init_fnc(xfer, ft_outgoing_init); 5039 gaim_xfer_set_init_fnc(xfer, ft_outgoing_init);
5042 gaim_xfer_set_cancel_send_fnc(xfer, ft_outgoing_cancel); 5040 gaim_xfer_set_cancel_send_fnc(xfer, ft_outgoing_cancel);
5041
5042 return xfer;
5043 }
5044
5045 static void mw_prpl_send_file(GaimConnection *gc,
5046 const char *who, const char *file) {
5047
5048 GaimXfer *xfer = mw_prpl_new_xfer(gc, who);
5043 5049
5044 if(file) { 5050 if(file) {
5045 DEBUG_INFO("file != NULL\n"); 5051 DEBUG_INFO("file != NULL\n");
5046 gaim_xfer_request_accepted(xfer, file); 5052 gaim_xfer_request_accepted(xfer, file);
5047 5053
5107 .find_blist_chat = NULL, 5113 .find_blist_chat = NULL,
5108 .roomlist_get_list = NULL, 5114 .roomlist_get_list = NULL,
5109 .roomlist_expand_category = NULL, 5115 .roomlist_expand_category = NULL,
5110 .can_receive_file = mw_prpl_can_receive_file, 5116 .can_receive_file = mw_prpl_can_receive_file,
5111 .send_file = mw_prpl_send_file, 5117 .send_file = mw_prpl_send_file,
5118 .new_xfer = mw_prpl_new_xfer,
5112 }; 5119 };
5113 5120
5114 5121
5115 static GaimPluginPrefFrame * 5122 static GaimPluginPrefFrame *
5116 mw_plugin_get_plugin_pref_frame(GaimPlugin *plugin) { 5123 mw_plugin_get_plugin_pref_frame(GaimPlugin *plugin) {