Mercurial > prosody-modules
comparison mod_invites_adhoc/mod_invites_adhoc.lua @ 5040:fa99279f9d40
mod_invites_adhoc: Set non-nil defaults for options, fixes traceback (thanks Martin)
Fixes an error when attempting to call the :empty() method on the
default implicit default nil value.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 14 Sep 2022 17:21:42 +0200 |
parents | 8b6fe33d1c9b |
children | f9cecbd03e11 |
comparison
equal
deleted
inserted
replaced
5039:c0d243b27e64 | 5040:fa99279f9d40 |
---|---|
12 -- keep this available to all local users. To allow/disallow invite-registration | 12 -- keep this available to all local users. To allow/disallow invite-registration |
13 -- on the server, use the option above instead. | 13 -- on the server, use the option above instead. |
14 local allow_contact_invites = module:get_option_boolean("allow_contact_invites", true); | 14 local allow_contact_invites = module:get_option_boolean("allow_contact_invites", true); |
15 | 15 |
16 -- These options are deprecated since module:may() | 16 -- These options are deprecated since module:may() |
17 local allow_user_invite_roles = module:get_option_set("allow_user_invites_by_roles"); | 17 local allow_user_invite_roles = module:get_option_set("allow_user_invites_by_roles", {}); |
18 local deny_user_invite_roles = module:get_option_set("deny_user_invites_by_roles"); | 18 local deny_user_invite_roles = module:get_option_set("deny_user_invites_by_roles", {}); |
19 | 19 |
20 if module.may then | 20 if module.may then |
21 if allow_user_invites then | 21 if allow_user_invites then |
22 module:default_permission("prosody:user", ":invite-new-users"); | 22 module:default_permission("prosody:user", ":invite-new-users"); |
23 end | 23 end |