diff libpurple/protocols/jabber/si.c @ 29274:e0e0cecdcd16

propagate from branch 'im.pidgin.pidgin' (head 53ec2e73334e6dc99c29f0f13b5ebf4700f5a92c) to branch 'im.pidgin.cpw.attention_ui' (head 2ce3177a8ec94edba0f242ea181a9bd0f2655751)
author Marcus Lundblad <ml@update.uu.se>
date Tue, 24 Feb 2009 20:26:34 +0000
parents 36c73d036026
children 050052891c55 b98519a42e53
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c	Fri Feb 06 23:31:35 2009 +0000
+++ b/libpurple/protocols/jabber/si.c	Tue Feb 24 20:26:34 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)