Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(visitors): Adds option to turn off auto promotion with token. #15099

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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