Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(visitors): Drops propagating moderator_id to visitor nodes.

damencho939fdf6c8ed2
diff --git a/resources/prosody-plugins/mod_fmuc.lua b/resources/prosody-plugins/mod_fmuc.lua
index 5efe0bf0fc..9753c3ef21 100644
--- a/resources/prosody-plugins/mod_fmuc.lua
+++ b/resources/prosody-plugins/mod_fmuc.lua
@@ -323,6 +323,7 @@ module:hook('muc-broadcast-presence', function (event)
-- a promotion detected let's send it to main prosody
if raiseHand then
local user_id;
+ local group_id;
local is_moderator;
local session = sessions[occupant.jid];
local identity = session and session.jitsi_meet_context_user;
@@ -338,12 +339,9 @@ module:hook('muc-broadcast-presence', function (event)
-- so we can be auto promoted
if identity and identity.id then
user_id = session.jitsi_meet_context_user.id;
+ group_id = session.jitsi_meet_context_group;
- if room._data.moderator_id then
- if room._data.moderator_id == user_id then
- is_moderator = true;
- end
- elseif session.auth_token and auto_promoted_with_token then
+ if session.auth_token and auto_promoted_with_token then
if not session.jitsi_meet_tenant_mismatch or session.jitsi_web_query_prefix == '' then
-- non-vpaas and having a token is considered a moderator, and if it is not in '/' tenant
-- the tenant from url and token should match
@@ -367,6 +365,7 @@ module:hook('muc-broadcast-presence', function (event)
jid = occupant.jid,
time = raiseHand,
userId = user_id,
+ groupId = group_id,
forcePromote = is_moderator and 'true' or 'false';
}):up();
@@ -642,7 +641,6 @@ local function iq_from_main_handler(event)
-- if this is update it will either set or remove the password
room:set_password(node.attr.password);
room._data.meetingId = node.attr.meetingId;
- room._data.moderator_id = node.attr.moderatorId;
local createdTimestamp = node.attr.createdTimestamp;
room.created_timestamp = createdTimestamp and tonumber(createdTimestamp) or nil;
diff --git a/resources/prosody-plugins/mod_visitors.lua b/resources/prosody-plugins/mod_visitors.lua
index 81ea5e1ab2..b0719e0792 100644
--- a/resources/prosody-plugins/mod_visitors.lua
+++ b/resources/prosody-plugins/mod_visitors.lua
@@ -65,7 +65,6 @@ local function send_visitors_iq(conference_service, room, type)
password = type ~= 'disconnect' and room:get_password() or '',
lobby = room._data.lobbyroom and 'true' or 'false',
meetingId = room._data.meetingId,
- moderatorId = room._data.moderator_id, -- can be used from external modules to set single moderator for meetings
createdTimestamp = room.created_timestamp and tostring(room.created_timestamp) or nil
});
diff --git a/resources/prosody-plugins/mod_visitors_component.lua b/resources/prosody-plugins/mod_visitors_component.lua
index 2afe5e13de..7d435f3d6b 100644
--- a/resources/prosody-plugins/mod_visitors_component.lua
+++ b/resources/prosody-plugins/mod_visitors_component.lua
@@ -71,7 +71,7 @@ function send_json_message(to_jid, json_message)
module:send(stanza);
end
-local function request_promotion_received(room, from_jid, from_vnode, nick, time, user_id, force_promote)
+local function request_promotion_received(room, from_jid, from_vnode, nick, time, user_id, group_id, force_promote)
-- if visitors is enabled for the room
if visitors_promotion_map[room.jid] then
-- only for raise hand, ignore lowering the hand
@@ -280,6 +280,7 @@ local function stanza_handler(event)
display_name,
tonumber(request_promotion.attr.time),
request_promotion.attr.userId,
+ request_promotion.attr.groupId,
request_promotion.attr.forcePromote
);
end