Software /
code /
prosody-modules
Comparison
mod_rest/jsonmap.lib.lua @ 3818:a607c69d0804
mod_rest: Guess 'get' as default type for 'iq' stanzas in JSON mapping
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 01 Jan 2020 17:37:04 +0100 |
parent | 3817:937f8c463be6 |
child | 3819:1bab6f67eb5f |
comparison
equal
deleted
inserted
replaced
3817:937f8c463be6 | 3818:a607c69d0804 |
---|---|
222 if t.to and not s.attr.to then | 222 if t.to and not s.attr.to then |
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 | |
228 if kind == "iq" and not t.type then | |
229 t.type = "get"; | |
227 end | 230 end |
228 | 231 |
229 if type(t.error) == "table" then | 232 if type(t.error) == "table" then |
230 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)); |
231 elseif t.type == "error" then | 234 elseif t.type == "error" then |