From 186ba70cb734f9cf67de216e7b9592b4e74507c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 19 Jun 2019 12:16:27 +0200 Subject: [PATCH] participants: skip local participant join notification Also, use the helper function to get the display name for a participant. --- react/features/base/participants/actions.js | 5 +---- react/features/base/participants/middleware.js | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/react/features/base/participants/actions.js b/react/features/base/participants/actions.js index 775e0cc50..bf585ef8e 100644 --- a/react/features/base/participants/actions.js +++ b/react/features/base/participants/actions.js @@ -1,5 +1,3 @@ -/* global interfaceConfig */ - import throttle from 'lodash/throttle'; import { set } from '../redux'; @@ -517,8 +515,7 @@ const _throttledNotifyParticipantConnected = throttle(dispatch => { * @returns {Function} */ export function showParticipantJoinedNotification(displayName) { - joinedParticipantsNames.push( - displayName || interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME); + joinedParticipantsNames.push(displayName); return dispatch => _throttledNotifyParticipantConnected(dispatch); } diff --git a/react/features/base/participants/middleware.js b/react/features/base/participants/middleware.js index 16befa7e0..e5e0ec419 100644 --- a/react/features/base/participants/middleware.js +++ b/react/features/base/participants/middleware.js @@ -118,10 +118,10 @@ MiddlewareRegistry.register(store => next => action => { case PARTICIPANT_JOINED: { _maybePlaySounds(store, action); - const { participant: { name } } = action; + const { participant: p } = action; - if (name) { - store.dispatch(showParticipantJoinedNotification(name)); + if (!p.local) { + store.dispatch(showParticipantJoinedNotification(getParticipantDisplayName(store.getState, p.id))); } return _participantJoinedOrUpdated(store, next, action);