# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1562880599 -7200
# Node ID 44371850c6b0dfb59d412449bf62389710996ae7
# Parent  c0702a1534cb86a9200c4c8e01a365c025d1f301
mod_mam: Move final log message to end of query procedure

diff -r c0702a1534cb -r 44371850c6b0 plugins/mod_mam/mod_mam.lua
--- a/plugins/mod_mam/mod_mam.lua	Thu Jul 11 23:27:45 2019 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Thu Jul 11 23:29:59 2019 +0200
@@ -200,13 +200,13 @@
 		first, last = last, first;
 	end
 
-	-- That's all folks!
-	module:log("debug", "Archive query id=%s completed, %d items returned", qid or stanza.attr.id, #results);
-
 	origin.send(st.reply(stanza)
 		:tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete })
 			:add_child(rsm.generate {
 				first = first, last = last, count = total }));
+
+	-- That's all folks!
+	module:log("debug", "Archive query id=%s completed, %d items returned", qid or stanza.attr.id, #results);
 	return true;
 end);