Comparison

plugins/mod_tombstones.lua @ 13209:c8d949cf6b09

plugins: Switch to :get_option_period() for time range options Improves readability ("1 day" vs 86400) and centralizes validation.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Jul 2023 20:49:33 +0200
parent 12977:74b9e05af71e
child 13213:50324f66ca2a
comparison
equal deleted inserted replaced
13208:a7c6ea1c5308 13209:c8d949cf6b09
8 -- Using a map store as key-value store so that removal of all user data 8 -- Using a map store as key-value store so that removal of all user data
9 -- does not also remove the tombstone, which would defeat the point 9 -- does not also remove the tombstone, which would defeat the point
10 local graveyard = module:open_store(nil, "map"); 10 local graveyard = module:open_store(nil, "map");
11 local graveyard_cache = require "prosody.util.cache".new(module:get_option_number("tombstone_cache_size", 1024)); 11 local graveyard_cache = require "prosody.util.cache".new(module:get_option_number("tombstone_cache_size", 1024));
12 12
13 local ttl = module:get_option_number("user_tombstone_expiry", nil); 13 local ttl = module:get_option_period("user_tombstone_expiry", nil);
14 -- Keep tombstones forever by default 14 -- Keep tombstones forever by default
15 -- 15 --
16 -- Rationale: 16 -- Rationale:
17 -- There is no way to be completely sure when remote services have 17 -- There is no way to be completely sure when remote services have
18 -- forgotten and revoked all memberships. 18 -- forgotten and revoked all memberships.