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
feat: don’t render moderator icon if everyone is moderator
Bettenbuk Zoltan5101f69e4ed3
diff --git a/react/features/base/participants/functions.js b/react/features/base/participants/functions.jsindex 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.jsindex 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<Props> {render() {const {_audioTrack: audioTrack,+ _isEveryoneModerator,_isModerator,_largeVideo: largeVideo,_onClick,@@ -172,7 +179,7 @@ class Thumbnail extends Component<Props> {{ renderDisplayName && <DisplayNameLabel participantId = { participantId } /> }- { participant.role === PARTICIPANT_ROLE.MODERATOR+ { !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR&& <View style = { styles.moderatorIndicatorContainer }><ModeratorIndicator /></View> }@@ -275,6 +282,7 @@ function _mapStateToProps(state, ownProps) {return {_audioTrack: audioTrack,+ _isEveryoneModerator: isEveryoneModerator(state),_isModerator: isLocalParticipantModerator(state),_largeVideo: largeVideo,_styles: ColorSchemeRegistry.get(state, 'Thumbnail'),