mod_disco: Reflect requested 'node' attribute in the disco#info reply.

Mon, 12 Jul 2010 00:14:48 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 12 Jul 2010 00:14:48 +0500
changeset 3349
a416d714a905
parent 3348
3b84a84f472a
child 3350
f0e312c9da01

mod_disco: Reflect requested 'node' attribute in the disco#info reply.

plugins/mod_disco.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_disco.lua	Sun Jul 11 23:51:40 2010 +0500
+++ b/plugins/mod_disco.lua	Mon Jul 12 00:14:48 2010 +0500
@@ -88,7 +88,9 @@
 	if stanza.attr.type ~= "get" then return; end
 	local node = stanza.tags[1].attr.node;
 	if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event?
-	local reply = st.reply(stanza):add_child(get_server_disco_info());
+	local reply_query = get_server_disco_info();
+	reply_query.node = node;
+	local reply = st.reply(stanza):add_child(reply_query);
 	origin.send(reply);
 	return true;
 end);

mercurial