From 9452f06b27ba894c98d1a6b44a5a21e73ee7f1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 10 Oct 2017 15:07:40 -0500 Subject: [PATCH] [RN] Use JWT callee name in CallKit Fallback to the room name otherwise. This allows us to have better entries in the phone history. --- react/features/mobile/callkit/middleware.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/react/features/mobile/callkit/middleware.js b/react/features/mobile/callkit/middleware.js index 67900b258..734539e03 100644 --- a/react/features/mobile/callkit/middleware.js +++ b/react/features/mobile/callkit/middleware.js @@ -209,18 +209,22 @@ function _conferenceLeft(store, next, action) { function _conferenceWillJoin({ getState }, next, action) { const result = next(action); - const conference = action.conference; - const url = getInviteURL(getState); - const hasVideo = !isVideoMutedByAudioOnly(getState); + const { conference } = action; + const state = getState(); + const url = getInviteURL(state); + const hasVideo = !isVideoMutedByAudioOnly(state); // When assigning the call UUID, do so in upper case, since iOS will // return it upper cased. conference.callUUID = uuid.v4().toUpperCase(); CallKit.startCall(conference.callUUID, url.toString(), hasVideo) .then(() => { - const { room } = getState()['features/base/conference']; + const { room } = state['features/base/conference']; + const { callee } = state['features/jwt']; - CallKit.updateCall(conference.callUUID, { displayName: room }); + CallKit.updateCall( + conference.callUUID, + { displayName: (callee && callee.name) || room }); }); return result;