aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_invites_adhoc.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-05-06 17:08:49 +0100
committerMatthew Wild <mwild1@gmail.com>2022-05-06 17:08:49 +0100
commitaad451c07e02e83d5da4fbd4d4d9d8a9a54b8176 (patch)
tree231034ea01df22a1109e3347dee3dd8d4dd2765f /plugins/mod_invites_adhoc.lua
parent38c67064b3d36738e5db241041612eaeed6e79b4 (diff)
downloadprosody-aad451c07e02e83d5da4fbd4d4d9d8a9a54b8176.tar.gz
prosody-aad451c07e02e83d5da4fbd4d4d9d8a9a54b8176.zip
mod_invites_adhoc: Fall back to generic allow_user_invites for role-less users
Fixes #1752
Diffstat (limited to 'plugins/mod_invites_adhoc.lua')
-rw-r--r--plugins/mod_invites_adhoc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_invites_adhoc.lua b/plugins/mod_invites_adhoc.lua
index 4554d919..bd6f0c2e 100644
--- a/plugins/mod_invites_adhoc.lua
+++ b/plugins/mod_invites_adhoc.lua
@@ -45,7 +45,11 @@ local invite_result_form = dataforms.new({
local function may_invite_new_users(jid)
if usermanager.get_roles then
local user_roles = usermanager.get_roles(jid, module.host);
- if not user_roles then return; end
+ if not user_roles then
+ -- User has no roles we can check, just return default
+ return allow_user_invites;
+ end
+
if user_roles["prosody:admin"] then
return true;
end