From 1987a7411f6aab1b0534ef23dc8797362eae1076 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 16 Jul 2023 20:49:33 +0200 Subject: plugins: Switch to :get_option_period() for time range options Improves readability ("1 day" vs 86400) and centralizes validation. --- plugins/muc/lock.lib.lua | 2 +- plugins/muc/mod_muc.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/muc') diff --git a/plugins/muc/lock.lib.lua b/plugins/muc/lock.lib.lua index 27264816..bb5bf82b 100644 --- a/plugins/muc/lock.lib.lua +++ b/plugins/muc/lock.lib.lua @@ -10,7 +10,7 @@ local st = require "prosody.util.stanza"; local lock_rooms = module:get_option_boolean("muc_room_locking", true); -local lock_room_timeout = module:get_option_number("muc_room_lock_timeout", 300); +local lock_room_timeout = module:get_option_period("muc_room_lock_timeout", "5 minutes"); local function lock(room) module:fire_event("muc-room-locked", {room = room;}); diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index f26934be..b8a0d480 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -389,7 +389,7 @@ end); if module:get_option_boolean("muc_tombstones", true) then - local ttl = module:get_option_number("muc_tombstone_expiry", 86400 * 31); + local ttl = module:get_option_period("muc_tombstone_expiry", "31 days"); module:hook("muc-room-destroyed",function(event) local room = event.room; -- cgit v1.2.3