diff --git a/react/features/base/participants/functions.js b/react/features/base/participants/functions.js index 1a73a75b8e..10f5c873b5 100644 --- a/react/features/base/participants/functions.js +++ b/react/features/base/participants/functions.js @@ -260,6 +260,25 @@ function _getAllParticipants(stateful) { : toState(stateful)['features/base/participants'] || []); } +/** + * Returns true if all of the meeting participants are moderators. + * + * @param {Object|Function} stateful -Object or function that can be resolved + * to the Redux state. + * @returns {boolean} + */ +export function isEveryoneModerator(stateful: Object | Function) { + const participants = _getAllParticipants(stateful); + + for (const participant of participants) { + if (participant.role !== PARTICIPANT_ROLE.MODERATOR) { + return false; + } + } + + return true; +} + /** * Returns true if the current local participant is a moderator in the * conference. diff --git a/react/features/filmstrip/components/native/Thumbnail.js b/react/features/filmstrip/components/native/Thumbnail.js index c6d6393034..6aa4b0eb00 100644 --- a/react/features/filmstrip/components/native/Thumbnail.js +++ b/react/features/filmstrip/components/native/Thumbnail.js @@ -10,6 +10,7 @@ import { Audio, MEDIA_TYPE } from '../../../base/media'; import { PARTICIPANT_ROLE, ParticipantView, + isEveryoneModerator, isLocalParticipantModerator, pinParticipant } from '../../../base/participants'; @@ -38,6 +39,11 @@ type Props = { */ _audioTrack: Object, + /** + * True if everone in the meeting is moderator. + */ + _isEveryoneModerator: boolean, + /** * True if the local participant is a moderator. */ @@ -117,6 +123,7 @@ class Thumbnail extends Component { render() { const { _audioTrack: audioTrack, + _isEveryoneModerator, _isModerator, _largeVideo: largeVideo, _onClick, @@ -172,7 +179,7 @@ class Thumbnail extends Component { { renderDisplayName && } - { participant.role === PARTICIPANT_ROLE.MODERATOR + { !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR && } @@ -275,6 +282,7 @@ function _mapStateToProps(state, ownProps) { return { _audioTrack: audioTrack, + _isEveryoneModerator: isEveryoneModerator(state), _isModerator: isLocalParticipantModerator(state), _largeVideo: largeVideo, _styles: ColorSchemeRegistry.get(state, 'Thumbnail'),