Software /
code /
prosody
Changeset
13410:7efdd143fdfc
mod_invites: Allow specifying invite ttl on command line
Was missing a way to pass TTL via command or shell.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 13 Jan 2024 10:58:12 +0100 |
parents | 13409:95d8875c90dc |
children | 13411:d815882d2692 |
files | plugins/mod_invites.lua |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_invites.lua Sun Dec 17 19:02:56 2023 +0100 +++ b/plugins/mod_invites.lua Sat Jan 13 10:58:12 2024 +0100 @@ -4,6 +4,7 @@ local jid_node = require "prosody.util.jid".node; local jid_split = require "prosody.util.jid".split; local argparse = require "prosody.util.argparse"; +local human_io = require "prosody.util.human.io"; local default_ttl = module:get_option_period("invite_expiry", "1 week"); @@ -283,6 +284,7 @@ print(" --role ROLE Grant the given ROLE to the new user") print(" --group GROUPID Add the user to the group with the given ID") print(" Can be specified multiple times") + print(" --expires-after T Time until the invite expires (e.g. '1 week')") print() print("--group can be specified multiple times; the user will be added to all groups.") print() @@ -332,7 +334,7 @@ invite = assert(invites.create_account(nil, { roles = roles, groups = groups - })); + }, opts.expires_after and human_io.parse_duration(opts.expires_after))); end print(invite.landing_page or invite.uri);