pidgin: 3a615f78: purple_xfer_new only returns NULL if an ...

markdoliner at pidgin.im markdoliner at pidgin.im
Fri Mar 27 05:35:21 EDT 2009


-----------------------------------------------------------------
Revision: 3a615f781139bb1a1f48cfd4e27eb1d32e85f650
Ancestor: d775af435b48cfb0e8dcaeab3721eb2d5f0a47de
Author: markdoliner at pidgin.im
Date: 2009-03-27T09:34:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3a615f781139bb1a1f48cfd4e27eb1d32e85f650

Modified files:
        libpurple/protocols/jabber/si.c

ChangeLog: 

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

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/si.c	8fd72d9feb3dd155236267ea1adfdf8b6cd81cca
+++ libpurple/protocols/jabber/si.c	2819e1852deffa25ef1177f1690409b3dbcef0c4
@@ -1662,23 +1662,22 @@ void jabber_si_parse(JabberStream *js, x
 	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);
 
-		purple_xfer_set_filename(xfer, filename);
-		if(filesize > 0)
-			purple_xfer_set_size(xfer, filesize);
+	xfer->data = jsx;
 
-		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_filename(xfer, filename);
+	if(filesize > 0)
+		purple_xfer_set_size(xfer, filesize);
 
-		js->file_transfers = g_list_append(js->file_transfers, xfer);
+	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_request(xfer);
-	}
+	js->file_transfers = g_list_append(js->file_transfers, xfer);
+
+	purple_xfer_request(xfer);
 }
 
 void


More information about the Commits mailing list