Diff

plugins/mod_invites_adhoc.lua @ 12491:dc0c20753d6c 0.12

mod_invites_adhoc: Fall back to generic allow_user_invites for role-less users Fixes #1752
author Matthew Wild <mwild1@gmail.com>
date Fri, 06 May 2022 17:08:49 +0100
parent 12145:212bac94aedd
child 12642:9061f9621330
line wrap: on
line diff
--- a/plugins/mod_invites_adhoc.lua	Thu May 05 14:10:59 2022 +0200
+++ b/plugins/mod_invites_adhoc.lua	Fri May 06 17:08:49 2022 +0100
@@ -45,7 +45,11 @@
 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