Skip to content

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

fix(toolbar-buttons) Hide rec and livestream buttons for non-moderators (#13328)

Horatiu Muresan44cc0f7e9a51
diff --git a/react/features/invite/functions.ts b/react/features/invite/functions.ts
index d8f7cc418b..eafd41b40f 100644
--- a/react/features/invite/functions.ts
+++ b/react/features/invite/functions.ts
@@ -463,12 +463,14 @@ export function isDialOutEnabled(state: IReduxState): boolean {
* Determines if inviting sip endpoints is enabled or not.
*
* @param {IReduxState} state - Current state.
- * @returns {boolean} Indication of whether dial out is currently enabled.
+ * @returns {boolean} Indication of whether sip invite is currently enabled.
*/
export function isSipInviteEnabled(state: IReduxState): boolean {
const { sipInviteUrl } = state['features/base/config'];
- return isJwtFeatureEnabled(state, 'sip-outbound-call') && Boolean(sipInviteUrl);
+ return isLocalParticipantModerator(state)
+ && isJwtFeatureEnabled(state, 'sip-outbound-call')
+ && Boolean(sipInviteUrl);
}
/**
diff --git a/react/features/recording/components/LiveStream/AbstractLiveStreamButton.ts b/react/features/recording/components/LiveStream/AbstractLiveStreamButton.ts
index a1d3727f9d..218dc76d74 100644
--- a/react/features/recording/components/LiveStream/AbstractLiveStreamButton.ts
+++ b/react/features/recording/components/LiveStream/AbstractLiveStreamButton.ts
@@ -131,8 +131,11 @@ export function _mapStateToProps(state: IReduxState, ownProps: IProps) {
const isModerator = isLocalParticipantModerator(state);
const liveStreaming = getLiveStreaming(state);
- visible = isModerator && liveStreaming.enabled;
- visible = isJwtFeatureEnabled(state, 'livestreaming', visible);
+ if (isModerator) {
+ visible = liveStreaming.enabled ? isJwtFeatureEnabled(state, 'livestreaming', true) : false;
+ } else {
+ visible = false;
+ }
}
// disable the button if the recording is running.
diff --git a/react/features/recording/functions.ts b/react/features/recording/functions.ts
index 0fd6ef833f..5666eed5d5 100644
--- a/react/features/recording/functions.ts
+++ b/react/features/recording/functions.ts
@@ -171,9 +171,13 @@ export function getRecordButtonProps(state: IReduxState) {
const localRecordingEnabled = !localRecording?.disable && supportsLocalRecording();
const dropboxEnabled = isDropboxEnabled(state);
+ const recordingEnabled = recordingService?.enabled || localRecordingEnabled || dropboxEnabled;
- visible = isModerator && (recordingService?.enabled || localRecordingEnabled || dropboxEnabled);
- visible = isJwtFeatureEnabled(state, 'recording', visible);
+ if (isModerator) {
+ visible = recordingEnabled ? isJwtFeatureEnabled(state, 'recording', true) : false;
+ } else {
+ visible = false;
+ }
// disable the button if the livestreaming is running.
if (visible && getActiveSession(state, JitsiRecordingConstants.mode.STREAM)) {