From fa9549582fdef140608ae7b4d919dce940fe2bcc Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Mon, 28 May 2018 20:43:28 -0500 Subject: [PATCH] Fix JitsiConference access With so many abstractions called conference, I'm not surprised I made a mistake and my reviewer didn't catch it. As we are transitioning from remote participants identified by ID alone to an ID-conference pair, the subsequent commits "Protect against late PARTICIPANT_JOINED" and "Refine PARTICIPANT_LEFT for ID collisions" caught the error. --- modules/UI/shared_video/SharedVideo.js | 9 +++++++-- react/features/base/participants/actions.js | 6 ++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js index c43bcc216..494d43a92 100644 --- a/modules/UI/shared_video/SharedVideo.js +++ b/modules/UI/shared_video/SharedVideo.js @@ -306,7 +306,12 @@ export default class SharedVideoManager { SHARED_VIDEO_CONTAINER_TYPE, self.sharedVideo); APP.store.dispatch(participantJoined({ - conference: APP.conference, + + // FIXME The cat is out of the bag already or rather _room is + // not private because it is used in multiple other places + // already such as AbstractPageReloadOverlay and + // JitsiMeetLogStorage. + conference: APP.conference._room, id: self.url, isBot: true, name: 'YouTube' @@ -517,7 +522,7 @@ export default class SharedVideoManager { UIEvents.UPDATE_SHARED_VIDEO, null, 'removed'); }); - APP.store.dispatch(participantLeft(this.url, APP.conference)); + APP.store.dispatch(participantLeft(this.url, APP.conference._room)); this.url = null; this.isSharedVideoShown = false; diff --git a/react/features/base/participants/actions.js b/react/features/base/participants/actions.js index 59575e306..ead4b0a32 100644 --- a/react/features/base/participants/actions.js +++ b/react/features/base/participants/actions.js @@ -2,6 +2,7 @@ import throttle from 'lodash/throttle'; +import { set } from '../redux'; import { showNotification } from '../../notifications'; import { @@ -113,10 +114,7 @@ export function localParticipantIdChanged(id) { * }} */ export function localParticipantJoined(participant = {}) { - return participantJoined({ - ...participant, - local: true - }); + return participantJoined(set(participant, 'local', true)); } /**