Changeset

3822:f0a1d113dce4

mod_rest: Add support for mapping 'node' attr in disco#info
author Kim Alvefur <zash@zash.se>
date Thu, 02 Jan 2020 09:28:18 +0100
parents 3821:11272a3233ce
children 3823:31b1797a78e1
files mod_rest/jsonmap.lib.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/jsonmap.lib.lua	Wed Jan 01 18:41:04 2020 +0100
+++ b/mod_rest/jsonmap.lib.lua	Thu Jan 02 09:28:18 2020 +0100
@@ -52,11 +52,12 @@
 					features:push(tag.attr.var);
 				end
 			end
-			return { identities = identities, features = features, };
+			return { node = s.attr.node, identities = identities, features = features, };
 		end;
 		function  (s)
 			local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info" });
 			if type(s) == "table" then
+				disco.attr.node = tostring(s.node);
 				if s.identities then
 					for identity in ipairs(s.identities) do
 						disco:tag("identity", { category = identity[1], type = identity[2] }):up();