ソースを参照

[RN] Use JWT callee name in CallKit

Fallback to the room name otherwise. This allows us to have better entries in
the phone history.
master
Saúl Ibarra Corretgé 8年前
コミット
9452f06b27
1個のファイルの変更9行の追加5行の削除
  1. 9
    5
      react/features/mobile/callkit/middleware.js

+ 9
- 5
react/features/mobile/callkit/middleware.js ファイルの表示

@@ -209,18 +209,22 @@ function _conferenceLeft(store, next, action) {
209 209
 function _conferenceWillJoin({ getState }, next, action) {
210 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 217
     // When assigning the call UUID, do so in upper case, since iOS will
217 218
     // return it upper cased.
218 219
     conference.callUUID = uuid.v4().toUpperCase();
219 220
     CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
220 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 230
     return result;

読み込み中…
キャンセル
保存