# HG changeset patch # User Kim Alvefur # Date 1520630279 -3600 # Node ID f7c3979358722aded81a6bb351fafa72d41a1f65 # Parent 801ae5cb13413684eb89ed6fd7a43d52d906347f# Parent b23da88b350701a3ef6e2bb7902c07efc02cefa7 Merge 0.10->trunk diff -r 801ae5cb1341 -r f7c397935872 plugins/mod_mam/mod_mam.lua --- a/plugins/mod_mam/mod_mam.lua Fri Mar 09 21:50:01 2018 +0100 +++ b/plugins/mod_mam/mod_mam.lua Fri Mar 09 22:17:59 2018 +0100 @@ -52,7 +52,7 @@ archive = module:require "fallback_archive"; end -local use_total = true; +local use_total = module:get_option_boolean("mam_include_total", true); local cleanup; @@ -129,7 +129,7 @@ qstart, qend = vstart, vend; end - module:log("debug", "Archive query, id %s with %s from %s until %s)", + module:log("debug", "Archive query, id %s with %s from %s until %s", tostring(qid), qwith or "anyone", qstart and timestamp(qstart) or "the dawn of time", qend and timestamp(qend) or "now"); @@ -334,9 +334,7 @@ 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 not archive.delete then - module:log("debug", "Selected storage driver does not support deletion, archives will not expire"); -elseif cleanup_after ~= "never" then +if 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]?)"); @@ -383,9 +381,10 @@ return math.random(cleanup_interval, cleanup_interval * 2); end); 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 = false; + use_total = module:get_option_boolean("mam_include_total", false); end -- Stanzas sent by local clients diff -r 801ae5cb1341 -r f7c397935872 plugins/muc/muc.lib.lua