comparison mod_rest/jsonmap.lib.lua @ 3848:1b9834500123

mod_rest: Fix iteration over disco#info identities
author Kim Alvefur <zash@zash.se>
date Sat, 25 Jan 2020 00:17:44 +0100
parents 31b1797a78e1
children 11c34e97fe1a
comparison
equal deleted inserted replaced
3847:ffc64d285a96 3848:1b9834500123
58 function (s) 58 function (s)
59 local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info" }); 59 local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info" });
60 if type(s) == "table" then 60 if type(s) == "table" then
61 disco.attr.node = tostring(s.node); 61 disco.attr.node = tostring(s.node);
62 if s.identities then 62 if s.identities then
63 for identity in ipairs(s.identities) do 63 for _, identity in ipairs(s.identities) do
64 disco:tag("identity", { category = identity[1], type = identity[2] }):up(); 64 disco:tag("identity", { category = identity[1], type = identity[2] }):up();
65 end 65 end
66 end 66 end
67 if s.features then 67 if s.features then
68 for feature in ipairs(s.features) do 68 for feature in ipairs(s.features) do