Comparison

mod_invites_adhoc/mod_invites_adhoc.lua @ 5593:04f36a470dca

Update from upstream
author Trần H. Trung <xmpp:trần.h.trung@trung.fun>
date Sun, 09 Jul 2023 01:31:29 +0700
parent 5582:825c6fb76c48
comparison
equal deleted inserted replaced
5591:680fb3344357 5593:04f36a470dca
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 if require "core.features".available:contains("split-user-roles") then
23 module:default_permission("prosody:registered", ":invite-new-users");
24 else -- COMPAT
25 module:default_permission("prosody:user", ":invite-new-users");
26 end
23 end 27 end
24 if not allow_user_invite_roles:empty() or not deny_user_invite_roles:empty() then 28 if not allow_user_invite_roles:empty() or not deny_user_invite_roles:empty() then
25 return error("allow_user_invites_by_roles and deny_user_invites_by_roles are deprecated options"); 29 return error("allow_user_invites_by_roles and deny_user_invites_by_roles are deprecated options");
26 end 30 end
27 end 31 end