From 88f8f48465c36070d8915df2e749aa65849c0fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 17 Nov 2022 11:05:28 +0100 Subject: [PATCH] fix(participants) don't treat Jigasi like a fake participant We only really want to know if a participant is Jigasi for displaying a specific icon, for all other intents and purposes it's a normal participant. --- react/features/base/participants/functions.ts | 12 +----------- react/features/base/participants/middleware.ts | 4 ++-- react/features/base/participants/types.ts | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/react/features/base/participants/functions.ts b/react/features/base/participants/functions.ts index e46b86cdf..6c7774d82 100644 --- a/react/features/base/participants/functions.ts +++ b/react/features/base/participants/functions.ts @@ -32,7 +32,7 @@ const AVATAR_CHECKED_URLS = new Map(); /* eslint-disable arrow-body-style, no-unused-vars */ const AVATAR_CHECKER_FUNCTIONS = [ (participant: IParticipant) => { - return isJigasiParticipant(participant) ? JIGASI_PARTICIPANT_ICON : null; + return participant?.isJigasi ? JIGASI_PARTICIPANT_ICON : null; }, (participant: IParticipant) => { return isWhiteboardParticipant(participant) ? WHITEBOARD_PARTICIPANT_ICON : null; @@ -281,16 +281,6 @@ export function getFakeParticipants(stateful: IStateful) { return toState(stateful)['features/base/participants'].fakeParticipants; } -/** - * Returns whether the fake participant is Jigasi. - * - * @param {IParticipant|undefined} participant - The participant entity. - * @returns {boolean} - True if it's a Jigasi participant. - */ -function isJigasiParticipant(participant?: IParticipant): boolean { - return participant?.fakeParticipant === FakeParticipant.Jigasi; -} - /** * Returns whether the fake participant is a local screenshare. * diff --git a/react/features/base/participants/middleware.ts b/react/features/base/participants/middleware.ts index 618c75bfd..f2ea70434 100644 --- a/react/features/base/participants/middleware.ts +++ b/react/features/base/participants/middleware.ts @@ -80,7 +80,7 @@ import { } from './functions'; import logger from './logger'; import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds'; -import { FakeParticipant, IJitsiParticipant } from './types'; +import { IJitsiParticipant } from './types'; import './subscriber'; @@ -438,7 +438,7 @@ StateListenerRegistry.register( store.dispatch(participantUpdated({ conference, id: participant.getId(), - fakeParticipant: value ? FakeParticipant.Jigasi : undefined + isJigasi: value })), // eslint-disable-next-line @typescript-eslint/no-unused-vars 'features_screen-sharing': (participant: IJitsiParticipant, value: string) => diff --git a/react/features/base/participants/types.ts b/react/features/base/participants/types.ts index de5e94062..7134c6ec5 100644 --- a/react/features/base/participants/types.ts +++ b/react/features/base/participants/types.ts @@ -1,5 +1,4 @@ export enum FakeParticipant { - Jigasi = 'Jigasi', LocalScreenShare = 'LocalScreenShare', RemoteScreenShare = 'RemoteScreenShare', SharedVideo = 'SharedVideo', @@ -21,6 +20,7 @@ export interface IParticipant { }; getId?: Function; id: string; + isJigasi?: boolean; isReplaced?: boolean; isReplacing?: number; jwtId?: string;