changeset 14109:3d1ac10a7901

mod_muc_mam: Honour 'archive_expires_after' if 'muc_log_expires_after' not set (thanks balejk) This allows for a more consistent setup, by setting archive_expires_after once in the global section.
author Matthew Wild <mwild1@gmail.com>
date Tue, 24 Mar 2026 12:51:01 +0000
parents 8e9ce4f01e2e
children 59064f0f8b4e
files CHANGES plugins/mod_muc_mam.lua
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Sun Mar 22 15:12:41 2026 +0100
+++ b/CHANGES	Tue Mar 24 12:51:01 2026 +0000
@@ -11,6 +11,7 @@
 - HTTP errors may be returned as JSON if Accept-ed
 - mod_http_file_share warns about missing or unexpected files in storage
 - mod_offline can now optionally expire old messages (like mod_mam)
+- mod_muc_mam honours `archive_expires_after` if `muc_log_expires_after` not set
 
 ### Shell
 
--- a/plugins/mod_muc_mam.lua	Sun Mar 22 15:12:41 2026 +0100
+++ b/plugins/mod_muc_mam.lua	Tue Mar 24 12:51:01 2026 +0000
@@ -34,7 +34,7 @@
 local timestamp, datestamp = import("prosody.util.datetime", "datetime", "date");
 local default_max_items, max_max_items = 20, module:get_option_integer("max_archive_query_results", 50, 0);
 
-local cleanup_after = module:get_option_period("muc_log_expires_after", "1w");
+local cleanup_after = module:get_option_period("muc_log_expires_after", module:get_option("archive_expires_after", "1w"));
 
 local default_history_length = 20;
 local max_history_length = module:get_option_integer("max_history_messages", math.huge, 0);