Diff

plugins/muc/lock.lib.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
line wrap: on
line diff
--- a/plugins/muc/lock.lib.lua	Sun Jul 16 21:04:42 2023 +0200
+++ b/plugins/muc/lock.lib.lua	Sun Jul 16 20:49:33 2023 +0200
@@ -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;});