mod_mam: Add an option for whether to include 'total' counts by default in queries
authorKim Alvefur <zash@zash.se>
Wed, 07 Mar 2018 15:05:20 +0100
changeset 8580 75d5eee6fcdf
parent 8579 07ff7b8b702b
child 8581 cf10cd3eb728
mod_mam: Add an option for whether to include 'total' counts by default in queries
plugins/mod_mam/mod_mam.lua
--- a/plugins/mod_mam/mod_mam.lua	Wed Mar 07 14:59:00 2018 +0100
+++ b/plugins/mod_mam/mod_mam.lua	Wed Mar 07 15:05:20 2018 +0100
@@ -52,7 +52,7 @@
 	archive = module:require "fallback_archive";
 end
 
-local use_total = true;
+local use_total = module:get_option_boolean("mam_include_total", true);
 
 local cleanup;
 
@@ -384,7 +384,7 @@
 	module:log("debug", "Archive expiry disabled");
 	-- Don't ask the backend to count the potentially unbounded number of items,
 	-- it'll get slow.
-	use_total = false;
+	use_total = module:get_option_boolean("mam_include_total", false);
 end
 
 -- Stanzas sent by local clients