changeset 17892: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 9d02fefaa589
children 11dd7969dd4b
files libpurple/protocols/jabber/disco.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/disco.c	Tue Jul 03 15:33:39 2007 +0000
+++ b/libpurple/protocols/jabber/disco.c	Tue Jul 03 15:34:34 2007 +0000
@@ -258,6 +258,17 @@
 	if(type && !strcmp(type, "get")) {
 		JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT,
 				"http://jabber.org/protocol/disco#items");
+		
+		/* preserve node */
+		xmlnode *iq_query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#items");
+		if(iq_query) {
+			xmlnode *query = xmlnode_get_child_with_namespace(packet,"query","http://jabber.org/protocol/disco#items");
+			if(query) {
+				const char *node = xmlnode_get_attrib(query,"node");
+				if(node)
+					xmlnode_set_attrib(iq_query,"node",node);
+			}
+		}
 
 		jabber_iq_set_id(iq, xmlnode_get_attrib(packet, "id"));