Переглянути джерело

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.
master
Leonard Kim 7 роки тому
джерело
коміт
f0a180cf0c
1 змінених файлів з 7 додано та 0 видалено
  1. 7
    0
      react/features/base/conference/actions.js

+ 7
- 0
react/features/base/conference/actions.js Переглянути файл

@@ -11,6 +11,7 @@ import { getName } from '../../app';
11 11
 import { JitsiConferenceEvents } from '../lib-jitsi-meet';
12 12
 import { setAudioMuted, setVideoMuted } from '../media';
13 13
 import {
14
+    MAX_DISPLAY_NAME_LENGTH,
14 15
     dominantSpeakerChanged,
15 16
     participantConnectionStatusChanged,
16 17
     participantJoined,
@@ -120,6 +121,12 @@ function _addConferenceListeners(conference, dispatch) {
120 121
         t => t && !t.isLocal() && dispatch(trackRemoved(t)));
121 122
 
122 123
     // Dispatches into features/base/participants follow:
124
+    conference.on(
125
+        JitsiConferenceEvents.DISPLAY_NAME_CHANGED,
126
+        (id, displayName) => dispatch(participantUpdated({
127
+            id,
128
+            name: displayName.substr(0, MAX_DISPLAY_NAME_LENGTH)
129
+        })));
123 130
 
124 131
     conference.on(
125 132
         JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,

Завантаження…
Відмінити
Зберегти