# HG changeset patch # User Kim Alvefur # Date 1577896624 -3600 # Node ID a607c69d08049b796b7afb4659971cd1a3cc1d63 # Parent 937f8c463be643e16df669d914b64d9fa8091fa1 mod_rest: Guess 'get' as default type for 'iq' stanzas in JSON mapping diff -r 937f8c463be6 -r a607c69d0804 mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Wed Jan 01 17:16:40 2020 +0100 +++ b/mod_rest/jsonmap.lib.lua Wed Jan 01 17:37:04 2020 +0100 @@ -225,6 +225,9 @@ if t.from and not s.attr.from then return nil, "invalid-jid-from"; end + if kind == "iq" and not t.type then + t.type = "get"; + end if type(t.error) == "table" then return st.error_reply(st.reply(s), str(t.error.type), str(t.error.condition), str(t.error.text));