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(audio-translation): hide the feature when unavailable for the room (#17574)

Jonathan Lennoxf26f0248f081
diff --git a/react/features/audio-translation/functions.ts b/react/features/audio-translation/functions.ts
index 9fd41f9f61..426434826e 100644
--- a/react/features/audio-translation/functions.ts
+++ b/react/features/audio-translation/functions.ts
@@ -38,6 +38,13 @@ export function isAudioTranslationAvailable(state: IReduxState): boolean {
return false;
}
+ // A deployment can hide the feature for a room via the audioTranslationAvailable RoomMetadata flag
+ // (e.g. when the translation backend is not provisioned for it). Absent, or any value other than an
+ // explicit false, means available. Applies even to those who could otherwise manage it.
+ if (state['features/base/conference'].metadata?.audioTranslationAvailable === false) {
+ return false;
+ }
+
return canManageAudioTranslation(state) || isAudioTranslationRoomEnabled(state);
}
diff --git a/react/features/base/conference/reducer.ts b/react/features/base/conference/reducer.ts
index 1cac0d3943..d03667c2b8 100644
--- a/react/features/base/conference/reducer.ts
+++ b/react/features/base/conference/reducer.ts
@@ -57,6 +57,13 @@ export interface IConferenceMetadata {
audioTranslation?: {
enabled?: boolean;
};
+
+ /**
+ * Server-controlled flag letting a deployment hide the audio-translation feature for a room (e.g. when
+ * the translation backend is not provisioned for it). Absent, or any value other than an explicit false,
+ * means available.
+ */
+ audioTranslationAvailable?: boolean;
dialinEnabled?: boolean;
files: {
[fileId: string]: {
diff --git a/resources/prosody-plugins/mod_room_metadata_component.lua b/resources/prosody-plugins/mod_room_metadata_component.lua
index 4ad343caf6..b06ad97d3d 100644
--- a/resources/prosody-plugins/mod_room_metadata_component.lua
+++ b/resources/prosody-plugins/mod_room_metadata_component.lua
@@ -106,6 +106,7 @@ local extdisco_occpuant_check = module:get_option_boolean('extdisco_occpuant_che
local blocked_metadata_keys = module:get_option_set('room_metadata_blocked_keys', {
'allownersEnabled',
'asyncTranscription',
+ 'audioTranslationAvailable',
'conferencePresetsServiceEnabled',
'dialinEnabled',
'moderators',