[RN] Don't process invite events if the external API scope doesn't match

This can happen if there are multiple JitsiMeetView instances are active at the
same time, because there is a single bridge, which means all of them would get
the events.
This commit is contained in:
Saúl Ibarra Corretgé 2018-05-02 13:43:42 +02:00 committed by Lyubo Marinov
parent ed7d8ac57e
commit 552fadc4a4
1 changed files with 16 additions and 1 deletions

View File

@ -139,6 +139,14 @@ function _onInvite(
{ addPeopleControllerScope, externalAPIScope, invitees }) { { addPeopleControllerScope, externalAPIScope, invitees }) {
const { getState } = this; // eslint-disable-line no-invalid-this const { getState } = this; // eslint-disable-line no-invalid-this
const state = getState(); const state = getState();
// If there are multiple JitsiMeetView instances alive, they will all get
// the event, since there is a single bridge, so make sure we don't act if
// the event is not for us.
if (state['features/app'].app.props.externalAPIScope !== externalAPIScope) {
return;
}
const { conference } = state['features/base/conference']; const { conference } = state['features/base/conference'];
const { inviteServiceUrl } = state['features/base/config']; const { inviteServiceUrl } = state['features/base/config'];
const options = { const options = {
@ -167,8 +175,15 @@ function _onInvite(
function _onPerformQuery( function _onPerformQuery(
{ addPeopleControllerScope, externalAPIScope, query }) { { addPeopleControllerScope, externalAPIScope, query }) {
const { getState } = this; // eslint-disable-line no-invalid-this const { getState } = this; // eslint-disable-line no-invalid-this
const state = getState(); const state = getState();
// If there are multiple JitsiMeetView instances alive, they will all get
// the event, since there is a single bridge, so make sure we don't act if
// the event is not for us.
if (state['features/app'].app.props.externalAPIScope !== externalAPIScope) {
return;
}
const { const {
dialOutAuthUrl, dialOutAuthUrl,
peopleSearchQueryTypes, peopleSearchQueryTypes,