mod_mam: Add an option for whether to include 'total' counts by default in queries
--- 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