# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1520431520 -3600
# Node ID 75d5eee6fcdf4cefef5831c6383fa1900604da94
# Parent  07ff7b8b702b89d719c77f29c5f362d2447ad573
mod_mam: Add an option for whether to include 'total' counts by default in queries

diff -r 07ff7b8b702b -r 75d5eee6fcdf 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