mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
KeyVerificationCoordinator: Handle secrets recovery flow from complete security.
This commit is contained in:
parent
95456f1193
commit
48f6e03c36
1 changed files with 27 additions and 0 deletions
|
@ -173,6 +173,17 @@ final class KeyVerificationCoordinator: KeyVerificationCoordinatorType {
|
|||
return coordinator
|
||||
}
|
||||
|
||||
private func showSecretsRecovery(with recoveryMode: SecretsRecoveryMode) {
|
||||
let coordinator = SecretsRecoveryCoordinator(session: self.session, recoveryMode: recoveryMode, navigationRouter: self.navigationRouter)
|
||||
coordinator.delegate = self
|
||||
coordinator.start()
|
||||
|
||||
self.add(childCoordinator: coordinator)
|
||||
self.navigationRouter.setRootModule(coordinator) { [weak self] in
|
||||
self?.remove(childCoordinator: coordinator)
|
||||
}
|
||||
}
|
||||
|
||||
private func createSelfVerificationCoordinator(otherDeviceId: String) -> KeyVerificationSelfVerifyStartCoordinator {
|
||||
let coordinator = KeyVerificationSelfVerifyStartCoordinator(session: self.session, otherDeviceId: otherDeviceId)
|
||||
coordinator.delegate = self
|
||||
|
@ -412,6 +423,10 @@ extension KeyVerificationCoordinator: KeyVerificationSelfVerifyWaitCoordinatorDe
|
|||
func keyVerificationSelfVerifyWaitCoordinatorDidCancel(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType) {
|
||||
self.didCancel()
|
||||
}
|
||||
|
||||
func keyVerificationSelfVerifyWaitCoordinator(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType, wantsToRecoverSecretsWith secretsRecoveryMode: SecretsRecoveryMode) {
|
||||
self.showSecretsRecovery(with: secretsRecoveryMode)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - KeyVerificationScanConfirmationCoordinatorDelegate
|
||||
|
@ -425,3 +440,15 @@ extension KeyVerificationCoordinator: KeyVerificationScanConfirmationCoordinator
|
|||
self.didCancel()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SecretsRecoveryCoordinatorDelegate
|
||||
extension KeyVerificationCoordinator: SecretsRecoveryCoordinatorDelegate {
|
||||
|
||||
func secretsRecoveryCoordinatorDidRecover(_ coordinator: SecretsRecoveryCoordinatorType) {
|
||||
self.showVerified(animated: true)
|
||||
}
|
||||
|
||||
func secretsRecoveryCoordinatorDidCancel(_ coordinator: SecretsRecoveryCoordinatorType) {
|
||||
self.didCancel()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue