Software /
code /
prosody
Diff
plugins/mod_invites.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 | 13161:9ba11ef91ce4 |
child | 13353:27512ebcc8af |
line wrap: on
line diff
--- a/plugins/mod_invites.lua Sun Jul 16 21:04:42 2023 +0200 +++ b/plugins/mod_invites.lua Sun Jul 16 20:49:33 2023 +0200 @@ -5,7 +5,7 @@ local jid_split = require "prosody.util.jid".split; local argparse = require "prosody.util.argparse"; -local default_ttl = module:get_option_number("invite_expiry", 86400 * 7); +local default_ttl = module:get_option_period("invite_expiry", "1 week"); local token_storage; if prosody.process_type == "prosody" or prosody.shutdown then