aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_muc_mam.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-05-27 19:17:12 +0200
committerKim Alvefur <zash@zash.se>2019-05-27 19:17:12 +0200
commit0f41a59a9661bdd737ae343567d73bc47a5d5ba6 (patch)
treeff8dba22a43f87b20109ab298eb508300dd1ffe9 /plugins/mod_muc_mam.lua
parent58b5ba4345e115ac259166cd84b6f8a42d15d0f8 (diff)
parent5cc63a416a1552da3259418db96d63af12079651 (diff)
downloadprosody-0f41a59a9661bdd737ae343567d73bc47a5d5ba6.tar.gz
prosody-0f41a59a9661bdd737ae343567d73bc47a5d5ba6.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_muc_mam.lua')
-rw-r--r--plugins/mod_muc_mam.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua
index bba7f422..eb93a386 100644
--- a/plugins/mod_muc_mam.lua
+++ b/plugins/mod_muc_mam.lua
@@ -458,8 +458,14 @@ if cleanup_after ~= "never" then
-- messages, we collect the union of sets of rooms from dates that fall
-- outside the cleanup range.
+ local last_date = require "util.cache".new(module:get_option_number("muc_log_cleanup_date_cache_size", 1000));
function schedule_cleanup(roomname, date)
- cleanup_map:set(date or datestamp(), roomname, true);
+ date = date or datestamp();
+ if last_date:get(roomname) == date then return end
+ local ok = cleanup_map:set(date, roomname, true);
+ if ok then
+ last_date:set(roomname, date);
+ end
end
cleanup_runner = require "util.async".runner(function ()