From db93331e685a8cdf6b9a2512a9f0ab8940fe2fd8 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 7 Mar 2018 14:46:55 +0100 Subject: Backed out changeset 97a094fdf101, interferes with 6ddddfe05a74 --- plugins/mod_mam/mod_mam.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index 353fe1a2..a0e317eb 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -334,9 +334,7 @@ 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 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]?)"); -- cgit v1.2.3 From 07c0bc5d5413f254fce624bba798a5e36b434670 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 7 Mar 2018 14:59:00 +0100 Subject: mod_mam: Log a debug message if archive expiry has been disabled --- plugins/mod_mam/mod_mam.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index a0e317eb..a8b3aad2 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -381,6 +381,7 @@ if cleanup_after ~= "never" then 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; -- cgit v1.2.3 From 1e6c295b684a7b9519454a72d9d0e04e8bc72d1b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 7 Mar 2018 15:05:20 +0100 Subject: mod_mam: Add an option for whether to include 'total' counts by default in queries --- plugins/mod_mam/mod_mam.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index a8b3aad2..781a9e62 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -52,7 +52,7 @@ if archive.name == "null" or not archive.find then archive = module:require "fallback_archive"; end -local use_total = true; +local use_total = module:get_option_boolean("mam_include_total", true); local cleanup; @@ -384,7 +384,7 @@ 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 -- cgit v1.2.3 From 7f55f83d48ed4f5a290863c8d204411cf3e38ece Mon Sep 17 00:00:00 2001 From: Jonas Wielicki Date: Thu, 8 Mar 2018 17:36:36 +0100 Subject: MUC: send muc#stanza_id feature as per XEP-0045 v1.31 (fixes #1097) --- plugins/muc/muc.lib.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 8930feeb..5d8c6df5 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -213,6 +213,7 @@ function room_mt:get_disco_info(stanza) local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#info") :tag("identity", {category="conference", type="text", name=self:get_name()}):up() :tag("feature", {var="http://jabber.org/protocol/muc"}):up() + :tag("feature", {var="http://jabber.org/protocol/muc#stable_id"}):up() :tag("feature", {var=self:get_password() and "muc_passwordprotected" or "muc_unsecured"}):up() :tag("feature", {var=self:get_moderated() and "muc_moderated" or "muc_unmoderated"}):up() :tag("feature", {var=self:get_members_only() and "muc_membersonly" or "muc_open"}):up() -- cgit v1.2.3 From fa1406845d82696641d04c0cc8005a416766761d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 9 Mar 2018 21:51:06 +0100 Subject: mod_mam: Remove unmatched closing paren --- plugins/mod_mam/mod_mam.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index 781a9e62..cf622e0f 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -129,7 +129,7 @@ module:hook("iq-set/self/"..xmlns_mam..":query", function(event) 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"); -- cgit v1.2.3