Device Verification: Plug it in the code more

This commit is contained in:
manuroe
2019-04-17 08:09:43 +02:00
parent 3bbc964333
commit 806ec410b5
8 changed files with 40 additions and 66 deletions
@@ -151,11 +151,11 @@ extension DeviceVerificationCoordinator: DeviceVerificationStartCoordinatorDeleg
}
func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didTransactionCancelled transaction: MXSASTransaction) {
self.delegate?.deviceVerificationCoordinatorDidComplete(self)
self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId)
}
func deviceVerificationStartCoordinatorDidCancel(_ coordinator: DeviceVerificationStartCoordinatorType) {
self.delegate?.deviceVerificationCoordinatorDidComplete(self)
self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId)
}
}
@@ -165,7 +165,7 @@ extension DeviceVerificationCoordinator: DeviceVerificationIncomingCoordinatorDe
}
func deviceVerificationIncomingCoordinatorDidCancel(_ coordinator: DeviceVerificationIncomingCoordinatorType) {
self.delegate?.deviceVerificationCoordinatorDidComplete(self)
self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId)
}
}
@@ -175,16 +175,16 @@ extension DeviceVerificationCoordinator: DeviceVerificationVerifyCoordinatorDele
}
func deviceVerificationVerifyCoordinatorDidCancel(_ coordinator: DeviceVerificationVerifyCoordinatorType) {
self.delegate?.deviceVerificationCoordinatorDidComplete(self)
self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId)
}
}
extension DeviceVerificationCoordinator: DeviceVerificationVerifiedViewControllerDelegate {
func deviceVerificationVerifiedViewControllerDidTapSetupAction(_ viewController: DeviceVerificationVerifiedViewController) {
self.delegate?.deviceVerificationCoordinatorDidComplete(self)
self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId)
}
func deviceVerificationVerifiedViewControllerDidCancel(_ viewController: DeviceVerificationVerifiedViewController) {
self.delegate?.deviceVerificationCoordinatorDidComplete(self)
self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId)
}
}
@@ -19,7 +19,7 @@
import Foundation
@objc protocol DeviceVerificationCoordinatorBridgePresenterDelegate {
func deviceVerificationCoordinatorBridgePresenterDelegateDidComplete(_ coordinatorBridgePresenter: DeviceVerificationCoordinatorBridgePresenter)
func deviceVerificationCoordinatorBridgePresenterDelegateDidComplete(_ coordinatorBridgePresenter: DeviceVerificationCoordinatorBridgePresenter, otherUserId: String, otherDeviceId: String)
}
/// DeviceVerificationCoordinatorBridgePresenter enables to start DeviceVerificationCoordinator from a view controller.
@@ -82,7 +82,7 @@ final class DeviceVerificationCoordinatorBridgePresenter: NSObject {
// MARK: - DeviceVerificationCoordinatorDelegate
extension DeviceVerificationCoordinatorBridgePresenter: DeviceVerificationCoordinatorDelegate {
func deviceVerificationCoordinatorDidComplete(_ coordinator: DeviceVerificationCoordinatorType) {
self.delegate?.deviceVerificationCoordinatorBridgePresenterDelegateDidComplete(self)
func deviceVerificationCoordinatorDidComplete(_ coordinator: DeviceVerificationCoordinatorType, otherUserId: String, otherDeviceId: String) {
self.delegate?.deviceVerificationCoordinatorBridgePresenterDelegateDidComplete(self, otherUserId: otherUserId, otherDeviceId: otherDeviceId)
}
}
@@ -19,7 +19,7 @@
import Foundation
protocol DeviceVerificationCoordinatorDelegate: class {
func deviceVerificationCoordinatorDidComplete(_ coordinator: DeviceVerificationCoordinatorType)
func deviceVerificationCoordinatorDidComplete(_ coordinator: DeviceVerificationCoordinatorType, otherUserId: String, otherDeviceId: String)
}
/// `DeviceVerificationCoordinatorType` is a protocol describing a Coordinator that handle keybackup setup navigation flow.