Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(recording) do not show advanced options for users with local recording rights
Avram Tudor9b61ad3616de
diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx b/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsxindex 880d418019..6251e6d02f 100644--- a/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx@@ -9,7 +9,7 @@ import { _abstractMapStateToProps } from '../../../base/dialog/functions';import { isLocalParticipantModerator } from '../../../base/participants/functions';import { authorizeDropbox, updateDropboxToken } from '../../../dropbox/actions';import { isVpaasMeeting } from '../../../jaas/functions';-import { canStartTranscribing } from '../../../subtitles/functions';+import { canAddTranscriber } from '../../../transcribing/functions';import { RECORDING_TYPES } from '../../constants';import { supportsLocalRecording } from '../../functions';@@ -418,7 +418,7 @@ export function mapStateToProps(state: IReduxState) {return {..._abstractMapStateToProps(state),isVpaas: isVpaasMeeting(state),- _canStartTranscribing: canStartTranscribing(state),+ _canStartTranscribing: canAddTranscriber(state),_hideStorageWarning: Boolean(recordingService?.hideStorageWarning),_isModerator: isLocalParticipantModerator(state),_localRecordingAvailable,diff --git a/react/features/subtitles/components/AbstractClosedCaptionButton.tsx b/react/features/subtitles/components/AbstractClosedCaptionButton.tsxindex c91a6dd031..cd5d305f29 100644--- a/react/features/subtitles/components/AbstractClosedCaptionButton.tsx+++ b/react/features/subtitles/components/AbstractClosedCaptionButton.tsx@@ -4,7 +4,7 @@ import { IReduxState } from '../../app/types';import { MEET_FEATURES } from '../../base/jwt/constants';import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';import { maybeShowPremiumFeatureDialog } from '../../jaas/actions';-import { canStartTranscribing } from '../functions';+import { canStartSubtitles } from '../functions';export interface IAbstractProps extends AbstractButtonProps {@@ -106,7 +106,7 @@ export function _abstractMapStateToProps(state: IReduxState, ownProps: IAbstract// if the participant is moderator, it can enable transcriptions and if// transcriptions are already started for the meeting, guests can just show them- const { visible = canStartTranscribing(state) } = ownProps;+ const { visible = canStartSubtitles(state) } = ownProps;return {_requestingSubtitles,diff --git a/react/features/subtitles/functions.ts b/react/features/subtitles/functions.tsindex e0ef8eaf00..de46e3c87d 100644--- a/react/features/subtitles/functions.ts+++ b/react/features/subtitles/functions.ts@@ -1,15 +1,12 @@import { IReduxState } from '../app/types';-import { isLocalParticipantModerator } from '../base/participants/functions';-import { isTranscribing } from '../transcribing/functions';+import { canAddTranscriber, isTranscribing } from '../transcribing/functions';/**- * Checks whether the participant can start the transcription.+ * Checks whether the participant can start the subtitles.** @param {IReduxState} state - The redux state.- * @returns {boolean} - True if the participant can start the transcription.+ * @returns {boolean} - True if the participant can start the subtitles.*/-export function canStartTranscribing(state: IReduxState) {- const { transcription } = state['features/base/config'];-- return Boolean(transcription?.enabled && (isLocalParticipantModerator(state) || isTranscribing(state)));+export function canStartSubtitles(state: IReduxState) {+ return canAddTranscriber(state) || isTranscribing(state);}diff --git a/react/features/transcribing/functions.ts b/react/features/transcribing/functions.tsindex ecb23037cc..d8e0301fa5 100644--- a/react/features/transcribing/functions.ts+++ b/react/features/transcribing/functions.ts@@ -2,6 +2,7 @@ import i18next from 'i18next';import { IReduxState } from '../app/types';import { IConfig } from '../base/config/configType';+import { isLocalParticipantModerator } from '../base/participants/functions';import JITSI_TO_BCP47_MAP from './jitsi-bcp47-map.json';import logger from './logger';@@ -53,3 +54,18 @@ export function determineTranscriptionLanguage(config: IConfig) {export function isTranscribing(state: IReduxState) {return state['features/transcribing'].isTranscribing;}++/**+ * Checks whether the participant can start the transcription.+ *+ * @param {IReduxState} state - The redux state.+ * @returns {boolean} - True if the participant can start the transcription.+ */+export function canAddTranscriber(state: IReduxState) {+ const { transcription } = state['features/base/config'];++ return Boolean(+ transcription?.enabled+ && isLocalParticipantModerator(state)+ );+}