Skip to content

Commit

Permalink
feat(visitors): Adds option to turn off auto promotion with token.
Browse files Browse the repository at this point in the history
Fixes #14699.
  • Loading branch information
damencho committed Sep 6, 2024
1 parent 0fa02ff commit b989307
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resources/prosody-plugins/mod_fmuc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ local local_muc_domain = muc_domain_prefix..'.'..local_domain;

local NICK_NS = 'http://jabber.org/protocol/nick';

-- in certain cases we consider participants with token as moderators, this is the default behavior which can be turned off
local auto_promoted_with_token = module:get_option_boolean('visitors_auto_promoted_with_token', true);

-- we send stats for the total number of rooms, total number of participants and total number of visitors
local measure_rooms = module:measure('vnode-rooms', 'amount');
local measure_participants = module:measure('vnode-participants', 'amount');
Expand Down Expand Up @@ -251,8 +254,8 @@ module:hook('muc-broadcast-presence', function (event)
if room._data.moderator_id == user_id then
is_moderator = true;
end
elseif session.auth_token then
-- non-vpass and having a token is considered a moderator
elseif session.auth_token and auto_promoted_with_token then
-- non-vpaas and having a token is considered a moderator
is_moderator = true;
end
end
Expand Down

0 comments on commit b989307

Please sign in to comment.