comparison mod_mam/mod_mam.lua @ 2021:5fb917b86838

mod_mam: Merge identical conditional blocks
author Kim Alvefur <zash@zash.se>
date Tue, 19 Jan 2016 14:34:12 +0100
parents 37b30f10fbba
children 77b9c7e5fd63
comparison
equal deleted inserted replaced
2020:37b30f10fbba 2021:5fb917b86838
183 183
184 if reverse then 184 if reverse then
185 for i = #results, 1, -1 do 185 for i = #results, 1, -1 do
186 origin.send(results[i]); 186 origin.send(results[i]);
187 end 187 end
188 first, last = last, first;
188 end 189 end
189 190
190 -- That's all folks! 191 -- That's all folks!
191 module:log("debug", "Archive query %s completed", tostring(qid)); 192 module:log("debug", "Archive query %s completed", tostring(qid));
192 193
193 if reverse then first, last = last, first; end
194 origin.send(st.message(msg_reply_attr) 194 origin.send(st.message(msg_reply_attr)
195 :tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete }) 195 :tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete })
196 :add_child(rsm.generate { 196 :add_child(rsm.generate {
197 first = first, last = last, count = total })); 197 first = first, last = last, count = total }));
198 return true; 198 return true;