parent
c6a280e005
commit
e724acc978
|
@ -410,8 +410,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
OutboundCallInitiator *outboundCallInitiator = [Environment getCurrent].outboundCallInitiator;
|
||||
OWSAssert(outboundCallInitiator);
|
||||
[outboundCallInitiator initiateCallWithHandle:phoneNumber];
|
||||
return YES;
|
||||
return [outboundCallInitiator initiateCallWithHandle:phoneNumber];
|
||||
} else if ([userActivity.activityType isEqualToString:@"INStartAudioCallIntent"]) {
|
||||
|
||||
if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(10, 0)) {
|
||||
|
@ -455,8 +454,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
OutboundCallInitiator *outboundCallInitiator = [Environment getCurrent].outboundCallInitiator;
|
||||
OWSAssert(outboundCallInitiator);
|
||||
[outboundCallInitiator initiateCallWithHandle:phoneNumber];
|
||||
return YES;
|
||||
return [outboundCallInitiator initiateCallWithHandle:phoneNumber];
|
||||
} else {
|
||||
DDLogWarn(@"%@ called %s with userActivity: %@, but not yet supported.",
|
||||
self.tag,
|
||||
|
|
|
@ -23,33 +23,30 @@ import Foundation
|
|||
/**
|
||||
* |handle| is a user formatted phone number, e.g. from a system contacts entry
|
||||
*/
|
||||
public func initiateCall(handle: String) {
|
||||
public func initiateCall(handle: String) -> Bool {
|
||||
Logger.info("\(TAG) in \(#function) with handle: \(handle)")
|
||||
|
||||
guard let recipientId = PhoneNumber(fromUserSpecifiedText: handle)?.toE164() else {
|
||||
Logger.warn("\(TAG) unable to parse signalId from phone number: \(handle)")
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
initiateCall(recipientId: recipientId)
|
||||
return initiateCall(recipientId: recipientId)
|
||||
}
|
||||
|
||||
/**
|
||||
* |recipientId| is a e164 formatted phone number.
|
||||
*/
|
||||
public func initiateCall(recipientId: String) {
|
||||
self.initiateWebRTCAudioCall(recipientId: recipientId)
|
||||
}
|
||||
|
||||
private func initiateWebRTCAudioCall(recipientId: String) {
|
||||
// Rather than an init-assigned dependency property, we access `callUIAdapter` via Environment
|
||||
public func initiateCall(recipientId: String) -> Bool {
|
||||
// Rather than an init-assigned dependency property, we access `callUIAdapter` via Environment
|
||||
// because it can change after app launch due to user settings
|
||||
guard let callUIAdapter = Environment.getCurrent().callUIAdapter else {
|
||||
assertionFailure()
|
||||
Logger.error("\(TAG) can't initiate call because callUIAdapter is nil")
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
callUIAdapter.startAndShowOutgoingCall(recipientId: recipientId)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue