|
|
|
|
@ -320,7 +320,18 @@ final class CallVC : UIViewController, WebRTCSessionDelegate, VideoPreviewDelega
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal func showCallModal() {
|
|
|
|
|
let callModal = CallModal() { [weak self] in
|
|
|
|
|
self?.answerCall()
|
|
|
|
|
}
|
|
|
|
|
callModal.modalPresentationStyle = .overFullScreen
|
|
|
|
|
callModal.modalTransitionStyle = .crossDissolve
|
|
|
|
|
present(callModal, animated: true, completion: nil)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc private func answerCall() {
|
|
|
|
|
let userDefaults = UserDefaults.standard
|
|
|
|
|
if userDefaults[.hasSeenCallIPExposureWarning] {
|
|
|
|
|
if case let .answer(sdp) = mode {
|
|
|
|
|
callInfoLabel.text = "Connecting..."
|
|
|
|
|
webRTCSession.handleRemoteSDP(sdp, from: sessionID) // This sends an answer message internally
|
|
|
|
|
@ -329,6 +340,10 @@ final class CallVC : UIViewController, WebRTCSessionDelegate, VideoPreviewDelega
|
|
|
|
|
self.answerButton.isHidden = true
|
|
|
|
|
}, completion: nil)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
userDefaults[.hasSeenCallIPExposureWarning] = true
|
|
|
|
|
showCallModal()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc private func endCall() {
|
|
|
|
|
|