aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-07-16 20:49:33 +0200
committerKim Alvefur <zash@zash.se>2023-07-16 20:49:33 +0200
commit1987a7411f6aab1b0534ef23dc8797362eae1076 (patch)
tree47c52d7b27c3b76cb1356f1a512105f1df2e8592 /plugins/muc
parent903e945d09ffd94ebf3f08b6c5092a56ad484348 (diff)
downloadprosody-1987a7411f6aab1b0534ef23dc8797362eae1076.tar.gz
prosody-1987a7411f6aab1b0534ef23dc8797362eae1076.zip
plugins: Switch to :get_option_period() for time range options
Improves readability ("1 day" vs 86400) and centralizes validation.
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/lock.lib.lua2
-rw-r--r--plugins/muc/mod_muc.lua2
2 files changed, 2 insertions, 2 deletions
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;