# HG changeset patch # User Kim Alvefur # Date 1674317695 -3600 # Node ID cd738fb8c7542172d3477d3f43a3de4f197385e6 # Parent 71dc48a89e5ad76cdf36b938b8adc970c3405e4f mod_muc_mam: Copy "include total" behavior from mod_mam Not sure why this was missing from MUC MAM, it already had some of the code for dealing with it. diff -r 71dc48a89e5a -r cd738fb8c754 plugins/mod_muc_mam.lua --- a/plugins/mod_muc_mam.lua Sat Jan 21 17:09:22 2023 +0100 +++ b/plugins/mod_muc_mam.lua Sat Jan 21 17:14:55 2023 +0100 @@ -67,6 +67,7 @@ module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information"); return false; end +local use_total = module:get_option_boolean("muc_log_include_total", true); local function archiving_enabled(room) if log_all_rooms then @@ -203,7 +204,7 @@ before = before; after = after; ids = qids; reverse = reverse; - total = qmax == 0; + total = use_total or qmax == 0; }); if not data then @@ -564,4 +565,7 @@ else 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 = module:get_option_boolean("mam_include_total", false); end