Software /
code /
prosody
Diff
plugins/mod_muc_mam.lua @ 10558:40c2500208f4
mod_muc_mam: Handle form identification error (e.g. not a form at all)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 23 Dec 2019 23:28:44 +0100 |
parent | 10415:360d574517b6 |
child | 10560:3adb6c46fbf4 |
line wrap: on
line diff
--- a/plugins/mod_muc_mam.lua Mon Dec 23 23:11:28 2019 +0100 +++ b/plugins/mod_muc_mam.lua Mon Dec 23 23:28:44 2019 +0100 @@ -145,7 +145,10 @@ local form = query:get_child("x", "jabber:x:data"); if form then local form_type, err = get_form_type(form); - if form_type ~= xmlns_mam then + if not form_type then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid dataform: "..err)); + return true; + elseif form_type ~= xmlns_mam then origin.send(st.error_reply(stanza, "modify", "bad-request", "Unexpected FORM_TYPE, expected '"..xmlns_mam.."'")); return true; end