diff libpurple/protocols/jabber/si.c @ 25433:36c73d036026

disapproval of revision '8a80f271858548f73cac50625660e87df1970bcc'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 08 Feb 2009 00:23:13 +0000
parents e30e9779e7bf
children 050052891c55 b98519a42e53
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c	Thu Feb 05 05:42:58 2009 +0000
+++ b/libpurple/protocols/jabber/si.c	Sun Feb 08 00:23:13 2009 +0000
@@ -1182,14 +1182,17 @@
 		purple_xfer_request(xfer);
 }
 
-void jabber_si_parse(JabberStream *js, xmlnode *si, const char *from, const char *id)
+void jabber_si_parse(JabberStream *js, xmlnode *packet)
 {
 	JabberSIXfer *jsx;
 	PurpleXfer *xfer;
-	xmlnode *file, *feature, *x, *field, *option, *value;
-	const char *stream_id, *filename, *filesize_c, *profile;
+	xmlnode *si, *file, *feature, *x, *field, *option, *value;
+	const char *stream_id, *filename, *filesize_c, *profile, *from;
 	size_t filesize = 0;
 
+	if(!(si = xmlnode_get_child(packet, "si")))
+		return;
+
 	if(!(profile = xmlnode_get_attrib(si, "profile")) ||
 			strcmp(profile, "http://jabber.org/protocol/si/profile/file-transfer"))
 		return;
@@ -1212,7 +1215,7 @@
 	if(!(x = xmlnode_get_child_with_namespace(feature, "x", "jabber:x:data")))
 		return;
 
-	if(!from)
+	if(!(from = xmlnode_get_attrib(packet, "from")))
 		return;
 
 	/* if they've already sent us this file transfer with the same damn id
@@ -1253,7 +1256,7 @@
 
 	jsx->js = js;
 	jsx->stream_id = g_strdup(stream_id);
-	jsx->iq_id = g_strdup(id);
+	jsx->iq_id = g_strdup(xmlnode_get_attrib(packet, "id"));
 
 	xfer = purple_xfer_new(js->gc->account, PURPLE_XFER_RECEIVE, from);
 	if (xfer)