fix(display-name): listen for display name changes

Make sure participants in the redux store have updated names.
This will be needed for showing avatars with user initials.
This commit is contained in:
Leonard Kim 2017-12-18 17:47:51 -08:00 committed by yanas
parent 28013f6ffa
commit f0a180cf0c
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import { getName } from '../../app';
import { JitsiConferenceEvents } from '../lib-jitsi-meet';
import { setAudioMuted, setVideoMuted } from '../media';
import {
MAX_DISPLAY_NAME_LENGTH,
dominantSpeakerChanged,
participantConnectionStatusChanged,
participantJoined,
@ -120,6 +121,12 @@ function _addConferenceListeners(conference, dispatch) {
t => t && !t.isLocal() && dispatch(trackRemoved(t)));
// Dispatches into features/base/participants follow:
conference.on(
JitsiConferenceEvents.DISPLAY_NAME_CHANGED,
(id, displayName) => dispatch(participantUpdated({
id,
name: displayName.substr(0, MAX_DISPLAY_NAME_LENGTH)
})));
conference.on(
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,