changeset 8315:52ea0ab31caa

[gaim-migrate @ 9039] it's gonna be a long night committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 22 Feb 2004 01:30:33 +0000
parents db1123eb56b0
children cf84056fed27
files src/protocols/jabber/iq.c
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/iq.c	Sun Feb 22 01:25:54 2004 +0000
+++ b/src/protocols/jabber/iq.c	Sun Feb 22 01:30:33 2004 +0000
@@ -241,7 +241,6 @@
 	xmlnode *query, *error, *x;
 	const char *xmlns;
 	const char *type, *id, *from;
-	JabberIq *iq;
 
 	query = xmlnode_get_child(packet, "query");
 	type = xmlnode_get_attrib(packet, "type");
@@ -311,18 +310,20 @@
 
 	/* If we get here, send the default error reply mandated by XMPP-CORE */
 
-	iq = jabber_iq_new(js, JABBER_IQ_ERROR);
+	if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) {
+		JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR);
 
-	xmlnode_free(iq->node);
-	iq->node = xmlnode_copy(packet);
-	xmlnode_set_attrib(iq->node, "to", from);
-	xmlnode_set_attrib(iq->node, "type", "error");
-	error = xmlnode_new_child(iq->node, "error");
-	xmlnode_set_attrib(error, "type", "cancel");
-	xmlnode_set_attrib(error, "code", "501");
-	x = xmlnode_new_child(error, "feature-not-implemented");
-	xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas");
+		xmlnode_free(iq->node);
+		iq->node = xmlnode_copy(packet);
+		xmlnode_set_attrib(iq->node, "to", from);
+		xmlnode_set_attrib(iq->node, "type", "error");
+		error = xmlnode_new_child(iq->node, "error");
+		xmlnode_set_attrib(error, "type", "cancel");
+		xmlnode_set_attrib(error, "code", "501");
+		x = xmlnode_new_child(error, "feature-not-implemented");
+		xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas");
 
-	jabber_iq_send(iq);
+		jabber_iq_send(iq);
+	}
 }