Clean up ahead of PR.

pull/1/head
Matthew Chen 6 years ago
parent 6b3fe04537
commit 41b7205b02

@ -79,6 +79,7 @@ public enum CallError: Error {
case timeout(description: String) case timeout(description: String)
case obsoleteCall(description: String) case obsoleteCall(description: String)
case fatalError(description: String) case fatalError(description: String)
case messageSendFailure(underlyingError: Error)
} }
// Should be roughly synced with Android client for consistency // Should be roughly synced with Android client for consistency
@ -100,7 +101,7 @@ protocol CallServiceObserver: class {
} }
protocol SignalCallDataDelegate: class { protocol SignalCallDataDelegate: class {
func outgoingIceUpdateDidFail(call: SignalCall) func outgoingIceUpdateDidFail(call: SignalCall, error: Error)
} }
// Gather all per-call state in one place. // Gather all per-call state in one place.
@ -261,7 +262,7 @@ private class SignalCallData: NSObject {
strongSelf.outgoingIceUpdatesInFlight = false strongSelf.outgoingIceUpdatesInFlight = false
strongSelf.tryToSendIceUpdates() strongSelf.tryToSendIceUpdates()
}.catch { [weak self] (_) in }.catch { [weak self] (error) in
AssertIsOnMainThread() AssertIsOnMainThread()
guard let strongSelf = self else { guard let strongSelf = self else {
@ -269,7 +270,7 @@ private class SignalCallData: NSObject {
} }
strongSelf.outgoingIceUpdatesInFlight = false strongSelf.outgoingIceUpdatesInFlight = false
strongSelf.delegate?.outgoingIceUpdateDidFail(call: strongSelf.call) strongSelf.delegate?.outgoingIceUpdateDidFail(call: strongSelf.call, error: error)
} }
sendPromise.retainUntilComplete() sendPromise.retainUntilComplete()
} }
@ -970,8 +971,6 @@ private class SignalCallData: NSObject {
private func handleIceConnected() { private func handleIceConnected() {
AssertIsOnMainThread() AssertIsOnMainThread()
Logger.verbose("-----.")
guard let call = self.call else { guard let call = self.call else {
// This will only be called for the current peerConnectionClient, so // This will only be called for the current peerConnectionClient, so
// fail the current call. // fail the current call.
@ -1896,12 +1895,14 @@ private class SignalCallData: NSObject {
// MARK: - SignalCallDataDelegate // MARK: - SignalCallDataDelegate
func outgoingIceUpdateDidFail(call: SignalCall) { func outgoingIceUpdateDidFail(call: SignalCall, error: Error) {
AssertIsOnMainThread()
guard self.call == call else { guard self.call == call else {
Logger.warn("obsolete call") Logger.warn("obsolete call")
return return
} }
terminateCall() handleFailedCall(failedCall: call, error: CallError.messageSendFailure(underlyingError: error))
} }
} }

Loading…
Cancel
Save