From a82ed4653e087d1ab0b2b0fa46328bc912197360 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Fri, 8 Jun 2018 13:08:45 -0500 Subject: [PATCH] [RN] Allow to override callHandle for CallKit (coding style) --- react/features/base/config/functions.js | 11 +++++------ react/features/mobile/callkit/middleware.js | 7 +++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/react/features/base/config/functions.js b/react/features/base/config/functions.js index abbfabe38..4e301dfa1 100644 --- a/react/features/base/config/functions.js +++ b/react/features/base/config/functions.js @@ -44,12 +44,11 @@ const WHITELISTED_KEYS = [ 'callDisplayName', /** - * The call handle of the CallKit call representing the conference/meeting - * associated with this config.js. The property is meant for use cases in - * which Jitsi Meet is to work with a CallKit call created outside of Jitsi - * Meet and to be adopted by Jitsi Meet such as, for example, an incoming - * and/or outgoing CallKit call created by Jitsi Meet SDK for iOS - * clients/consumers prior to giving control to Jitsi Meet. As the value is + * The handle + * ({@link https://developer.apple.com/documentation/callkit/cxhandle}) of + * the CallKit call representing the conference/meeting associated with this + * config.js. The property is meant for use cases in which the room URL is + * not desirable as the handle for CallKit purposes. As the value is * associated with a conference/meeting, the value makes sense not as a * deployment-wide configuration, only as a runtime configuration * override/overwrite provided by, for example, Jitsi Meet SDK for iOS. diff --git a/react/features/mobile/callkit/middleware.js b/react/features/mobile/callkit/middleware.js index d47663c6d..59e49e573 100644 --- a/react/features/mobile/callkit/middleware.js +++ b/react/features/mobile/callkit/middleware.js @@ -227,17 +227,16 @@ function _conferenceWillJoin({ getState }, next, action) { const { conference } = action; const state = getState(); - const { callUUID, callHandle } = state['features/base/config']; + const { callHandle, callUUID } = state['features/base/config']; const url = getInviteURL(state); + const handle = callHandle || url.toString(); const hasVideo = !isVideoMutedByAudioOnly(state); // When assigning the call UUID, do so in upper case, since iOS will return // it upper cased. conference.callUUID = (callUUID || uuid.v4()).toUpperCase(); - const handleURL = callHandle || url.toString(); - - CallKit.startCall(conference.callUUID, handleURL, hasVideo) + CallKit.startCall(conference.callUUID, handle, hasVideo) .then(() => { const { callee } = state['features/base/jwt']; const displayName