Comparison

mod_mam_muc/mod_mam_muc.lua @ 1546:fff2858c554f

mod_mam_muc: Remove parsing of 'with' field in MAM form, we currently ignore it anyways
author Kim Alvefur <zash@zash.se>
date Sat, 08 Nov 2014 15:45:19 +0100
parent 1543:57fb9ce21f9c
child 1547:e98c335c6554
comparison
equal deleted inserted replaced
1545:a104a159697d 1546:fff2858c554f
120 end 120 end
121 end 121 end
122 end); 122 end);
123 end 123 end
124 124
125 -- Note: We ignore the 'with' field as this is internally used for stanza types
125 local query_form = dataform { 126 local query_form = dataform {
126 { name = "FORM_TYPE"; type = "hidden"; value = xmlns_mam; }; 127 { name = "FORM_TYPE"; type = "hidden"; value = xmlns_mam; };
127 { name = "with"; type = "jid-single"; }; 128 { name = "with"; type = "jid-single"; };
128 { name = "start"; type = "text-single" }; 129 { name = "start"; type = "text-single" };
129 { name = "end"; type = "text-single"; }; 130 { name = "end"; type = "text-single"; };
157 end 158 end
158 159
159 local qid = query.attr.queryid; 160 local qid = query.attr.queryid;
160 161
161 -- Search query parameters 162 -- Search query parameters
162 local qwith, qstart, qend; 163 local qstart, qend;
163 local form = query:get_child("x", "jabber:x:data"); 164 local form = query:get_child("x", "jabber:x:data");
164 if form then 165 if form then
165 local err; 166 local err;
166 form, err = query_form:data(form); 167 form, err = query_form:data(form);
167 if err then 168 if err then
168 return origin.send(st.error_reply(stanza, "modify", "bad-request", select(2, next(err)))) 169 return origin.send(st.error_reply(stanza, "modify", "bad-request", select(2, next(err))))
169 end 170 end
170 qwith, qstart, qend = form["with"], form["start"], form["end"]; 171 qstart, qend = form["start"], form["end"];
171 qwith = qwith and jid_bare(qwith); -- dataforms does jidprep
172 end 172 end
173 173
174 if qstart or qend then -- Validate timestamps 174 if qstart or qend then -- Validate timestamps
175 local vstart, vend = (qstart and timestamp_parse(qstart)), (qend and timestamp_parse(qend)) 175 local vstart, vend = (qstart and timestamp_parse(qstart)), (qend and timestamp_parse(qend))
176 if (qstart and not vstart) or (qend and not vend) then 176 if (qstart and not vstart) or (qend and not vend) then