mod_mam_muc: Move swapping of reversed variables (like 5fb917b86838 for mod_mam)
authorKim Alvefur <zash@zash.se>
Tue, 14 Feb 2017 09:53:09 +0100
changeset 2506 f576ac1cad65
parent 2505 04064f01df0e
child 2507 7036a6e074d7
mod_mam_muc: Move swapping of reversed variables (like 5fb917b86838 for mod_mam)
mod_mam_muc/mod_mam_muc.lua
--- a/mod_mam_muc/mod_mam_muc.lua	Tue Feb 14 09:51:59 2017 +0100
+++ b/mod_mam_muc/mod_mam_muc.lua	Tue Feb 14 09:53:09 2017 +0100
@@ -259,12 +259,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 {