aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-09-12 14:59:52 +0200
committerKim Alvefur <zash@zash.se>2017-09-12 14:59:52 +0200
commit015bc6ad59c4fec1c353d9af6b4e111a287c2148 (patch)
tree3c5940a1dcb42c2a92d2df69737afabd462422e2 /plugins/mod_mam
parent863374e1643db918d328eac3185dab7b2abb0404 (diff)
downloadprosody-015bc6ad59c4fec1c353d9af6b4e111a287c2148.tar.gz
prosody-015bc6ad59c4fec1c353d9af6b4e111a287c2148.zip
mod_mam: Log a message in case archive deletion is not supported by the storage module in use
Diffstat (limited to 'plugins/mod_mam')
-rw-r--r--plugins/mod_mam/mod_mam.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 7511a1bc..298c770c 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -333,7 +333,9 @@ module:hook("pre-message/full", strip_stanza_id_after_other_events, -1);
local cleanup_after = module:get_option_string("archive_expires_after", "1w");
local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60);
-if cleanup_after ~= "never" then
+if not archive.delete then
+ module:log("debug", "Selected storage driver does not support deletion, archives will not expire");
+elseif cleanup_after ~= "never" then
local day = 86400;
local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day };
local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)");