Comparison

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
comparison
equal deleted inserted replaced
10557:e1cb869e2f6c 10558:40c2500208f4
143 -- Search query parameters 143 -- Search query parameters
144 local qstart, qend; 144 local qstart, qend;
145 local form = query:get_child("x", "jabber:x:data"); 145 local form = query:get_child("x", "jabber:x:data");
146 if form then 146 if form then
147 local form_type, err = get_form_type(form); 147 local form_type, err = get_form_type(form);
148 if form_type ~= xmlns_mam then 148 if not form_type then
149 origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid dataform: "..err));
150 return true;
151 elseif form_type ~= xmlns_mam then
149 origin.send(st.error_reply(stanza, "modify", "bad-request", "Unexpected FORM_TYPE, expected '"..xmlns_mam.."'")); 152 origin.send(st.error_reply(stanza, "modify", "bad-request", "Unexpected FORM_TYPE, expected '"..xmlns_mam.."'"));
150 return true; 153 return true;
151 end 154 end
152 form, err = query_form:data(form); 155 form, err = query_form:data(form);
153 if err then 156 if err then