comparison src/protocols/jabber/iq.c @ 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 4d05b6e9e9cd
comparison
equal deleted inserted replaced
8314:db1123eb56b0 8315:52ea0ab31caa
239 { 239 {
240 JabberCallbackData *jcd; 240 JabberCallbackData *jcd;
241 xmlnode *query, *error, *x; 241 xmlnode *query, *error, *x;
242 const char *xmlns; 242 const char *xmlns;
243 const char *type, *id, *from; 243 const char *type, *id, *from;
244 JabberIq *iq;
245 244
246 query = xmlnode_get_child(packet, "query"); 245 query = xmlnode_get_child(packet, "query");
247 type = xmlnode_get_attrib(packet, "type"); 246 type = xmlnode_get_attrib(packet, "type");
248 from = xmlnode_get_attrib(packet, "from"); 247 from = xmlnode_get_attrib(packet, "from");
249 id = xmlnode_get_attrib(packet, "id"); 248 id = xmlnode_get_attrib(packet, "id");
309 } 308 }
310 309
311 310
312 /* If we get here, send the default error reply mandated by XMPP-CORE */ 311 /* If we get here, send the default error reply mandated by XMPP-CORE */
313 312
314 iq = jabber_iq_new(js, JABBER_IQ_ERROR); 313 if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) {
315 314 JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR);
316 xmlnode_free(iq->node); 315
317 iq->node = xmlnode_copy(packet); 316 xmlnode_free(iq->node);
318 xmlnode_set_attrib(iq->node, "to", from); 317 iq->node = xmlnode_copy(packet);
319 xmlnode_set_attrib(iq->node, "type", "error"); 318 xmlnode_set_attrib(iq->node, "to", from);
320 error = xmlnode_new_child(iq->node, "error"); 319 xmlnode_set_attrib(iq->node, "type", "error");
321 xmlnode_set_attrib(error, "type", "cancel"); 320 error = xmlnode_new_child(iq->node, "error");
322 xmlnode_set_attrib(error, "code", "501"); 321 xmlnode_set_attrib(error, "type", "cancel");
323 x = xmlnode_new_child(error, "feature-not-implemented"); 322 xmlnode_set_attrib(error, "code", "501");
324 xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); 323 x = xmlnode_new_child(error, "feature-not-implemented");
325 324 xmlnode_set_attrib(x, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas");
326 jabber_iq_send(iq); 325
327 } 326 jabber_iq_send(iq);
328 327 }
328 }
329