diff 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
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua	Tue Jan 19 14:33:25 2016 +0100
+++ b/mod_mam/mod_mam.lua	Tue Jan 19 14:34:12 2016 +0100
@@ -185,12 +185,12 @@
 		for i = #results, 1, -1 do
 			origin.send(results[i]);
 		end
+		first, last = last, first;
 	end
 
 	-- That's all folks!
 	module:log("debug", "Archive query %s completed", tostring(qid));
 
-	if reverse then first, last = last, first; end
 	origin.send(st.message(msg_reply_attr)
 		:tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete })
 			:add_child(rsm.generate {