Browse Source

fix: Show livestream button only for moderators.

master
damencho 5 years ago
parent
commit
c007477ee9

+ 6
- 2
react/features/recording/components/LiveStream/AbstractLiveStreamButton.js View File

3
 import { openDialog } from '../../../base/dialog';
3
 import { openDialog } from '../../../base/dialog';
4
 import { IconLiveStreaming } from '../../../base/icons';
4
 import { IconLiveStreaming } from '../../../base/icons';
5
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
5
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
6
-import { getLocalParticipant } from '../../../base/participants';
6
+import {
7
+    getLocalParticipant,
8
+    isLocalParticipantModerator
9
+} from '../../../base/participants';
7
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
10
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
8
 import { getActiveSession } from '../../functions';
11
 import { getActiveSession } from '../../functions';
9
 
12
 
125
         // If the containing component provides the visible prop, that is one
128
         // If the containing component provides the visible prop, that is one
126
         // above all, but if not, the button should be autonomus and decide on
129
         // above all, but if not, the button should be autonomus and decide on
127
         // its own to be visible or not.
130
         // its own to be visible or not.
131
+        const isModerator = isLocalParticipantModerator(state);
128
         const {
132
         const {
129
             enableFeaturesBasedOnToken,
133
             enableFeaturesBasedOnToken,
130
             liveStreamingEnabled
134
             liveStreamingEnabled
131
         } = state['features/base/config'];
135
         } = state['features/base/config'];
132
         const { features = {} } = getLocalParticipant(state);
136
         const { features = {} } = getLocalParticipant(state);
133
 
137
 
134
-        visible = liveStreamingEnabled;
138
+        visible = isModerator && liveStreamingEnabled;
135
 
139
 
136
         if (enableFeaturesBasedOnToken) {
140
         if (enableFeaturesBasedOnToken) {
137
             visible = visible && String(features.livestreaming) === 'true';
141
             visible = visible && String(features.livestreaming) === 'true';

Loading…
Cancel
Save