Skip to content

Commit bbbc9d1

Browse files
committed
fix(visitors): Updates promotion path for non jaas meetings.
1 parent 0849055 commit bbbc9d1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

resources/prosody-plugins/mod_visitors_component.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ local function request_promotion_received(room, from_jid, from_vnode, nick, time
7676
-- if visitors is enabled for the room
7777
if visitors_promotion_map[room.jid] then
7878
local force_promote = auto_allow_promotion;
79-
8079
if not force_promote and force_promote_requested == 'true' then
8180
-- Let's do the force_promote checks if requested
82-
83-
-- _data.moderator_id can be used from external modules to set single moderator for a meeting
84-
-- or a whole group of moderators
85-
if room._data.moderator_id == user_id or room._data.moderator_id == group_id
81+
-- if it is vpaas meeting we trust the moderator computation from visitor node (value of force_promote_requested)
82+
-- if it is not vpaas we need to check further settings only if they exist
83+
if is_vpaas(room) or (not room._data.moderator_id and not room._data.moderators)
84+
-- _data.moderator_id can be used from external modules to set single moderator for a meeting
85+
-- or a whole group of moderators
86+
or (room._data.moderator_id
87+
and room._data.moderator_id == user_id or room._data.moderator_id == group_id)
8688

8789
-- all moderators are allowed to auto promote, the fact that user_id and force_promote_requested are set
8890
-- means that the user has token and is moderator on visitor node side

0 commit comments

Comments
 (0)