Mercurial > pidgin.yaz
comparison src/protocols/yahoo/yahoo_filexfer.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 | 2219f4bf4a57 |
children | de798f2f4bf1 |
comparison
equal
deleted
inserted
replaced
12142:0c672be21798 | 12143:cbebda5f019c |
---|---|
504 | 504 |
505 /* Now perform the request */ | 505 /* Now perform the request */ |
506 gaim_xfer_request(xfer); | 506 gaim_xfer_request(xfer); |
507 } | 507 } |
508 | 508 |
509 void yahoo_send_file(GaimConnection *gc, const char *who, const char *file) | 509 GaimXfer *yahoo_new_xfer(GaimConnection *gc, const char *who) |
510 { | 510 { |
511 GaimXfer *xfer; | 511 GaimXfer *xfer; |
512 struct yahoo_xfer_data *xfer_data; | 512 struct yahoo_xfer_data *xfer_data; |
513 | 513 |
514 if (!who) | 514 g_return_val_if_fail(who != NULL, NULL); |
515 return; | 515 |
516 | |
517 xfer_data = g_new0(struct yahoo_xfer_data, 1); | 516 xfer_data = g_new0(struct yahoo_xfer_data, 1); |
518 xfer_data->gc = gc; | 517 xfer_data->gc = gc; |
519 | 518 |
520 /* Build the file transfer handle. */ | 519 /* Build the file transfer handle. */ |
521 xfer = gaim_xfer_new(gc->account, GAIM_XFER_SEND, who); | 520 xfer = gaim_xfer_new(gc->account, GAIM_XFER_SEND, who); |
522 xfer->data = xfer_data; | 521 xfer->data = xfer_data; |
523 | 522 |
524 /* Setup our I/O op functions */ | 523 /* Setup our I/O op functions */ |
525 gaim_xfer_set_init_fnc(xfer, yahoo_xfer_init); | 524 gaim_xfer_set_init_fnc(xfer, yahoo_xfer_init); |
526 gaim_xfer_set_start_fnc(xfer, yahoo_xfer_start); | 525 gaim_xfer_set_start_fnc(xfer, yahoo_xfer_start); |
527 gaim_xfer_set_end_fnc(xfer, yahoo_xfer_end); | 526 gaim_xfer_set_end_fnc(xfer, yahoo_xfer_end); |
528 gaim_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); | 527 gaim_xfer_set_cancel_send_fnc(xfer, yahoo_xfer_cancel_send); |
529 gaim_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); | 528 gaim_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); |
530 gaim_xfer_set_read_fnc(xfer, yahoo_xfer_read); | 529 gaim_xfer_set_read_fnc(xfer, yahoo_xfer_read); |
531 gaim_xfer_set_write_fnc(xfer, yahoo_xfer_write); | 530 gaim_xfer_set_write_fnc(xfer, yahoo_xfer_write); |
532 | 531 |
532 return xfer; | |
533 } | |
534 | |
535 void yahoo_send_file(GaimConnection *gc, const char *who, const char *file) | |
536 { | |
537 GaimXfer *xfer = yahoo_new_xfer(gc, who); | |
538 | |
539 g_return_if_fail(xfer != NULL); | |
540 | |
533 /* Now perform the request */ | 541 /* Now perform the request */ |
534 if (file) | 542 if (file) |
535 gaim_xfer_request_accepted(xfer, file); | 543 gaim_xfer_request_accepted(xfer, file); |
536 else | 544 else |
537 gaim_xfer_request(xfer); | 545 gaim_xfer_request(xfer); |