comparison libpurple/protocols/jabber/disco.c @ 17619:22c848c81ccd

Now preserving the node on the (empty) disco#items replies. This is required for apps to add items on the correct nodes using signals.
author Andreas Monitzer <pidgin@monitzer.com>
date Tue, 03 Jul 2007 15:34:34 +0000
parents 9a19c46adf66
children 5c1ed6296b56
comparison
equal deleted inserted replaced
17618:9d02fefaa589 17619:22c848c81ccd
256 const char *type = xmlnode_get_attrib(packet, "type"); 256 const char *type = xmlnode_get_attrib(packet, "type");
257 257
258 if(type && !strcmp(type, "get")) { 258 if(type && !strcmp(type, "get")) {
259 JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, 259 JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT,
260 "http://jabber.org/protocol/disco#items"); 260 "http://jabber.org/protocol/disco#items");
261
262 /* preserve node */
263 xmlnode *iq_query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#items");
264 if(iq_query) {
265 xmlnode *query = xmlnode_get_child_with_namespace(packet,"query","http://jabber.org/protocol/disco#items");
266 if(query) {
267 const char *node = xmlnode_get_attrib(query,"node");
268 if(node)
269 xmlnode_set_attrib(iq_query,"node",node);
270 }
271 }
261 272
262 jabber_iq_set_id(iq, xmlnode_get_attrib(packet, "id")); 273 jabber_iq_set_id(iq, xmlnode_get_attrib(packet, "id"));
263 274
264 xmlnode_set_attrib(iq->node, "to", from); 275 xmlnode_set_attrib(iq->node, "to", from);
265 jabber_iq_send(iq); 276 jabber_iq_send(iq);