Mercurial > pidgin.yaz
changeset 26309:58daeb191c10
purple_xfer_new only returns NULL if an assertion fails, so we should do
a similar assertion check here instead of if(xfer). The rest of the
changes here are just removing indentation
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 27 Mar 2009 09:34:27 +0000 |
parents | 5c6cf6d1e65f |
children | f4161d588b25 |
files | libpurple/protocols/jabber/si.c |
diffstat | 1 files changed, 12 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c Fri Mar 27 09:29:22 2009 +0000 +++ b/libpurple/protocols/jabber/si.c Fri Mar 27 09:34:27 2009 +0000 @@ -1662,23 +1662,22 @@ jsx->iq_id = g_strdup(xmlnode_get_attrib(packet, "id")); xfer = purple_xfer_new(js->gc->account, PURPLE_XFER_RECEIVE, from); - if (xfer) - { - xfer->data = jsx; + g_return_if_fail(xfer != NULL); + + xfer->data = jsx; - purple_xfer_set_filename(xfer, filename); - if(filesize > 0) - purple_xfer_set_size(xfer, filesize); + purple_xfer_set_filename(xfer, filename); + if(filesize > 0) + purple_xfer_set_size(xfer, filesize); - purple_xfer_set_init_fnc(xfer, jabber_si_xfer_init); - purple_xfer_set_request_denied_fnc(xfer, jabber_si_xfer_request_denied); - purple_xfer_set_cancel_recv_fnc(xfer, jabber_si_xfer_cancel_recv); - purple_xfer_set_end_fnc(xfer, jabber_si_xfer_end); + purple_xfer_set_init_fnc(xfer, jabber_si_xfer_init); + purple_xfer_set_request_denied_fnc(xfer, jabber_si_xfer_request_denied); + purple_xfer_set_cancel_recv_fnc(xfer, jabber_si_xfer_cancel_recv); + purple_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); - purple_xfer_request(xfer); - } + purple_xfer_request(xfer); } void