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

[RN] Use JWT callee name in CallKit

Fallback to the room name otherwise. This allows us to have better entries in
the phone history.
j8
Saúl Ibarra Corretgé 7 роки тому
джерело
коміт
9452f06b27
1 змінених файлів з 9 додано та 5 видалено
  1. 9
    5
      react/features/mobile/callkit/middleware.js

+ 9
- 5
react/features/mobile/callkit/middleware.js Переглянути файл

209
 function _conferenceWillJoin({ getState }, next, action) {
209
 function _conferenceWillJoin({ getState }, next, action) {
210
     const result = next(action);
210
     const result = next(action);
211
 
211
 
212
-    const conference = action.conference;
213
-    const url = getInviteURL(getState);
214
-    const hasVideo = !isVideoMutedByAudioOnly(getState);
212
+    const { conference } = action;
213
+    const state = getState();
214
+    const url = getInviteURL(state);
215
+    const hasVideo = !isVideoMutedByAudioOnly(state);
215
 
216
 
216
     // When assigning the call UUID, do so in upper case, since iOS will
217
     // When assigning the call UUID, do so in upper case, since iOS will
217
     // return it upper cased.
218
     // return it upper cased.
218
     conference.callUUID = uuid.v4().toUpperCase();
219
     conference.callUUID = uuid.v4().toUpperCase();
219
     CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
220
     CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
220
         .then(() => {
221
         .then(() => {
221
-            const { room } = getState()['features/base/conference'];
222
+            const { room } = state['features/base/conference'];
223
+            const { callee } = state['features/jwt'];
222
 
224
 
223
-            CallKit.updateCall(conference.callUUID, { displayName: room });
225
+            CallKit.updateCall(
226
+                conference.callUUID,
227
+                { displayName: (callee && callee.name) || room });
224
         });
228
         });
225
 
229
 
226
     return result;
230
     return result;

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