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: honor updates of the local user role before conference join
Leonard Kima82bc1df64bf
diff --git a/conference.js b/conference.jsindex dee5fc8876..9f0152443f 100644--- a/conference.js+++ b/conference.js@@ -37,6 +37,7 @@ import {isFatalJitsiConnectionError} from './react/features/base/lib-jitsi-meet';import {+ localParticipantRoleChanged,participantJoined,participantLeft,participantRoleChanged,@@ -1262,14 +1263,18 @@ export default {room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {- APP.store.dispatch(participantRoleChanged(id, role));if (this.isLocalId(id)) {logger.info(`My role changed, new role: ${role}`);++ APP.store.dispatch(localParticipantRoleChanged(role));+if (this.isModerator !== room.isModerator()) {this.isModerator = room.isModerator();APP.UI.updateLocalRole(room.isModerator());}} else {+ APP.store.dispatch(participantRoleChanged(id, role));+let user = room.getParticipantById(id);if (user) {APP.UI.updateUserRole(user);diff --git a/react/features/base/participants/actions.js b/react/features/base/participants/actions.jsindex d1ffab6364..79661af657 100644--- a/react/features/base/participants/actions.js+++ b/react/features/base/participants/actions.js@@ -29,15 +29,12 @@ export function dominantSpeakerChanged(id) {}/**- * Action to signal that ID of local participant has changed. This happens when- * local participant joins a new conference or quits one.+ * Action to signal that the ID of local participant has changed. It happens+ * when the local participant joins a new conference or leaves an existing+ * conference.** @param {string} id - New ID for local participant.- * @returns {{- * type: PARTICIPANT_ID_CHANGED,- * newValue: string,- * oldValue: string- * }}+ * @returns {Function}*/export function localParticipantIdChanged(id) {return (dispatch, getState) => {@@ -69,6 +66,24 @@ export function localParticipantJoined(participant = {}) {});}+/**+ * Action to signal the role of the local participant has changed. It can happen+ * when the participant has joined a conference, even before a non-default local+ * id has been set, or after a moderator leaves.+ *+ * @param {string} role - The new role of the local participant.+ * @returns {Function}+ */+export function localParticipantRoleChanged(role) {+ return (dispatch, getState) => {+ const participant = getLocalParticipant(getState);++ if (participant) {+ return dispatch(participantRoleChanged(participant.id, role));+ }+ };+}+/*** Action to update a participant's connection status.*