Comparison

plugins/mod_mam/mod_mam.lua @ 8575:5040c8ce32dd

Backed out changeset 97a094fdf101, interferes with 6ddddfe05a74
author Kim Alvefur <zash@zash.se>
date Wed, 07 Mar 2018 14:46:55 +0100
parent 8538:3eb4cafb3b64
child 8576:07ff7b8b702b
comparison
equal deleted inserted replaced
8560:489998717387 8575:5040c8ce32dd
332 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1); 332 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1);
333 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); 333 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1);
334 334
335 local cleanup_after = module:get_option_string("archive_expires_after", "1w"); 335 local cleanup_after = module:get_option_string("archive_expires_after", "1w");
336 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); 336 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60);
337 if not archive.delete then 337 if cleanup_after ~= "never" then
338 module:log("debug", "Selected storage driver does not support deletion, archives will not expire");
339 elseif cleanup_after ~= "never" then
340 local day = 86400; 338 local day = 86400;
341 local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day }; 339 local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day };
342 local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)"); 340 local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)");
343 if not n then 341 if not n then
344 module:log("error", "Could not parse archive_expires_after string %q", cleanup_after); 342 module:log("error", "Could not parse archive_expires_after string %q", cleanup_after);