Comparison

mod_rest/jsonmap.lib.lua @ 3819:1bab6f67eb5f

mod_rest: Fix previous commit Working with the stanza, not the JSON table
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jan 2020 17:45:07 +0100
parent 3818:a607c69d0804
child 3822:f0a1d113dce4
comparison
equal deleted inserted replaced
3818:a607c69d0804 3819:1bab6f67eb5f
223 return nil, "invalid-jid-to"; 223 return nil, "invalid-jid-to";
224 end 224 end
225 if t.from and not s.attr.from then 225 if t.from and not s.attr.from then
226 return nil, "invalid-jid-from"; 226 return nil, "invalid-jid-from";
227 end 227 end
228 if kind == "iq" and not t.type then 228 if kind == "iq" and not s.attr.type then
229 t.type = "get"; 229 s.attr.type = "get";
230 end 230 end
231 231
232 if type(t.error) == "table" then 232 if type(t.error) == "table" then
233 return st.error_reply(st.reply(s), str(t.error.type), str(t.error.condition), str(t.error.text)); 233 return st.error_reply(st.reply(s), str(t.error.type), str(t.error.condition), str(t.error.text));
234 elseif t.type == "error" then 234 elseif t.type == "error" then