Mercurial > pidgin
diff src/protocols/jabber/si.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 | f9c5480ad0ce |
children | d5b8f4dc1622 |
line wrap: on
line diff
--- a/src/protocols/jabber/si.c Sat Nov 19 00:16:45 2005 +0000 +++ b/src/protocols/jabber/si.c Sat Nov 19 00:26:12 2005 +0000 @@ -655,7 +655,7 @@ } } -void jabber_si_xfer_send(GaimConnection *gc, const char *who, const char *file) +GaimXfer *jabber_si_new_xfer(GaimConnection *gc, const char *who) { JabberStream *js; @@ -664,9 +664,6 @@ js = gc->proto_data; - if(!gaim_find_buddy(gc->account, who) || !jabber_buddy_find(js, who, FALSE)) - return; - xfer = gaim_xfer_new(gc->account, GAIM_XFER_SEND, who); xfer->data = jsx = g_new0(JabberSIXfer, 1); @@ -676,7 +673,23 @@ gaim_xfer_set_cancel_send_fnc(xfer, jabber_si_xfer_cancel_send); gaim_xfer_set_end_fnc(xfer, jabber_si_xfer_end); - js->file_transfers = g_list_append(js->file_transfers, xfer); + js->file_transfers = g_list_append(js->file_transfers, xfer); + + return xfer; +} + +void jabber_si_xfer_send(GaimConnection *gc, const char *who, const char *file) +{ + JabberStream *js; + + GaimXfer *xfer; + + js = gc->proto_data; + + if(!gaim_find_buddy(gc->account, who) || !jabber_buddy_find(js, who, FALSE)) + return; + + xfer = jabber_si_new_xfer(gc, who); if (file) gaim_xfer_request_accepted(xfer, file);