diff options
author | Kim Alvefur <zash@zash.se> | 2023-01-21 17:14:55 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-01-21 17:14:55 +0100 |
commit | 81fd03356fbb451c5a7089a2520ebb7fbf6caf30 (patch) | |
tree | 7506b816cc2523136347c62f0b499b78e87e51a5 | |
parent | d0321442c91790342601ae3ea62ec2c1831801b4 (diff) | |
download | prosody-81fd03356fbb451c5a7089a2520ebb7fbf6caf30.tar.gz prosody-81fd03356fbb451c5a7089a2520ebb7fbf6caf30.zip |
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.
-rw-r--r-- | plugins/mod_muc_mam.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua index 6195b081..1c34b8af 100644 --- a/plugins/mod_muc_mam.lua +++ b/plugins/mod_muc_mam.lua @@ -67,6 +67,7 @@ if archive.name == "null" or not archive.find then 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 @@ module:hook("iq-set/bare/"..xmlns_mam..":query", function(event) 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 @@ if cleanup_after ~= "never" then 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 |