parent
065d383c15
commit
f5004b27ab
|
@ -18,12 +18,13 @@ final class CallKitCallManager: NSObject {
|
|||
|
||||
let TAG = "[CallKitCallManager]"
|
||||
let callController = CXCallController()
|
||||
static let kAnonymousCallHandlePrefix = "Signal:"
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
func startCall(_ call: SignalCall) {
|
||||
let handle = (Environment.getCurrent().preferences.isCallKitPrivacyEnabled()
|
||||
? CXHandle(type: .generic, value: call.localId.uuidString)
|
||||
? CXHandle(type: .generic, value: CallKitCallManager.kAnonymousCallHandlePrefix + call.localId.uuidString)
|
||||
: CXHandle(type: .phoneNumber, value: call.remotePhoneNumber))
|
||||
let startCallAction = CXStartCallAction(call: call.localId, handle: handle)
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ final class CallKitCallUIAdaptee: NSObject, CallUIAdaptee, CXProviderDelegate {
|
|||
// Construct a CXCallUpdate describing the incoming call, including the caller.
|
||||
let update = CXCallUpdate()
|
||||
update.remoteHandle = (Environment.getCurrent().preferences.isCallKitPrivacyEnabled()
|
||||
? CXHandle(type: .generic, value: call.localId.uuidString)
|
||||
? CXHandle(type: .generic, value: CallKitCallManager.kAnonymousCallHandlePrefix + call.localId.uuidString)
|
||||
: CXHandle(type: .phoneNumber, value: call.remotePhoneNumber))
|
||||
update.hasVideo = call.hasLocalVideo
|
||||
// Update the name used in the CallKit UI for incoming calls.
|
||||
|
@ -237,7 +237,15 @@ final class CallKitCallUIAdaptee: NSObject, CallUIAdaptee, CXProviderDelegate {
|
|||
_ = self.callService.handleOutgoingCall(call)
|
||||
action.fulfill()
|
||||
self.provider.reportOutgoingCall(with: call.localId, startedConnectingAt: nil)
|
||||
|
||||
ensureCallName(call:call)
|
||||
}
|
||||
|
||||
func ensureCallName(call : SignalCall) {
|
||||
guard Environment.getCurrent().preferences.isCallKitPrivacyEnabled() else {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the name used in the CallKit UI for outgoing calls.
|
||||
let update = CXCallUpdate()
|
||||
update.localizedCallerName = NSLocalizedString("CALLKIT_ANONYMOUS_CONTACT_NAME", comment: "The generic name used for calls if CallKit privacy is enabled")
|
||||
|
|
Loading…
Reference in New Issue