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(av_moderation): handle av_can_unmute policy

Robert Oanta5c7ed6a8b340
diff --git a/resources/prosody-plugins/mod_av_moderation_component.lua b/resources/prosody-plugins/mod_av_moderation_component.lua
index 6ac9560b0b..3e2d1f08c0 100644
--- a/resources/prosody-plugins/mod_av_moderation_component.lua
+++ b/resources/prosody-plugins/mod_av_moderation_component.lua
@@ -321,6 +321,22 @@ function occupant_joined(event)
return;
end
+ -- when first moderator joins if av_can_unmute from password preset is set to false, we enable av moderation for both
+ -- audio and video, and set the first moderator as the actor that enabled it
+ if (occupant.role == 'moderator') and room._data.av_can_unmute ~= nil and not room._data.av_first_moderator_joined then
+ if not room._data.av_can_unmute then
+ room.av_moderation = {
+ audio = array{},
+ video = array{}
+ };
+ room.av_moderation_actors = {
+ audio = occupant.nick,
+ video = occupant.nick
+ };
+ room._data.av_first_moderator_joined = true;
+ end
+ end
+
if room.av_moderation then
for _,mediaType in pairs({'audio', 'video'}) do
if room.av_moderation[mediaType] then