mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Merge pull request #3752 from vector-im/release/1.0.17/release
Release 1.0.17
This commit is contained in:
commit
ad7d5fd629
12 changed files with 190 additions and 27 deletions
29
CHANGES.rst
29
CHANGES.rst
|
@ -1,3 +1,32 @@
|
|||
Changes in 1.0.17 (2020-10-14)
|
||||
=================================================
|
||||
|
||||
✨ Features
|
||||
*
|
||||
|
||||
🙌 Improvements
|
||||
* Device verification: Do not check for existing key backup after SSSS & Cross-Signing reset.
|
||||
* Cross-signing: Detect when cross-signing keys have been changed.
|
||||
* Make copying & pasting media configurable.
|
||||
|
||||
🐛 Bugfix
|
||||
*
|
||||
|
||||
⚠️ API Changes
|
||||
*
|
||||
|
||||
🗣 Translations
|
||||
*
|
||||
|
||||
🧱 Build
|
||||
*
|
||||
|
||||
Others
|
||||
*
|
||||
|
||||
Improvements:
|
||||
* Upgrade MatrixKit version ([v0.12.25](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.12.25)).
|
||||
|
||||
Changes in 1.0.16 (2020-10-13)
|
||||
=================================================
|
||||
|
||||
|
|
|
@ -216,6 +216,8 @@ final class BuildSettings: NSObject {
|
|||
static let messageDetailsAllowPermalink: Bool = true
|
||||
static let messageDetailsAllowViewSource: Bool = true
|
||||
static let messageDetailsAllowSave: Bool = true
|
||||
static let messageDetailsAllowCopyMedia: Bool = true
|
||||
static let messageDetailsAllowPasteMedia: Bool = true
|
||||
|
||||
// MARK: - HTTP
|
||||
/// Additional HTTP headers will be sent by all requests. Not recommended to use request-specific headers, like `Authorization`.
|
||||
|
|
|
@ -43,6 +43,8 @@ class CommonConfiguration: NSObject, Configurable {
|
|||
|
||||
settings.messageDetailsAllowSharing = BuildSettings.messageDetailsAllowShare
|
||||
settings.messageDetailsAllowSaving = BuildSettings.messageDetailsAllowSave
|
||||
settings.messageDetailsAllowCopyingMedia = BuildSettings.messageDetailsAllowCopyMedia
|
||||
settings.messageDetailsAllowPastingMedia = BuildSettings.messageDetailsAllowPasteMedia
|
||||
|
||||
MXKContactManager.shared().allowLocalContactsAccess = BuildSettings.allowLocalContactsAccess
|
||||
}
|
||||
|
|
2
Podfile
2
Podfile
|
@ -11,7 +11,7 @@ use_frameworks!
|
|||
# - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI
|
||||
#
|
||||
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
|
||||
$matrixKitVersion = '0.12.24'
|
||||
$matrixKitVersion = '= 0.12.25'
|
||||
# $matrixKitVersion = :local
|
||||
# $matrixKitVersion = {'develop' => 'develop'}
|
||||
|
||||
|
|
|
@ -217,6 +217,8 @@
|
|||
B12676882523E4D100BE6B98 /* SecretsResetViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12676802523E4D100BE6B98 /* SecretsResetViewState.swift */; };
|
||||
B12676892523E4D100BE6B98 /* SecretsResetViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12676812523E4D100BE6B98 /* SecretsResetViewAction.swift */; };
|
||||
B126768A2523E4D100BE6B98 /* SecretsResetViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12676822523E4D100BE6B98 /* SecretsResetViewModel.swift */; };
|
||||
B1284E3E2535FEA6003529D7 /* SecureBackupSetupIntroViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1284E3D2535FEA6003529D7 /* SecureBackupSetupIntroViewModelType.swift */; };
|
||||
B1284E402535FEBA003529D7 /* SecureBackupSetupIntroViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1284E3F2535FEBA003529D7 /* SecureBackupSetupIntroViewModel.swift */; };
|
||||
B12C56EF2396CB5E00FAC6DE /* RoomMessageURLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12C56EE2396CB5E00FAC6DE /* RoomMessageURLParser.swift */; };
|
||||
B12D79FB23E2462200FACEDC /* UserVerificationStartCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B12D79F323E2462000FACEDC /* UserVerificationStartCoordinator.swift */; };
|
||||
B12D79FC23E2462200FACEDC /* UserVerificationStartViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B12D79F423E2462100FACEDC /* UserVerificationStartViewController.storyboard */; };
|
||||
|
@ -1243,6 +1245,8 @@
|
|||
B12676802523E4D100BE6B98 /* SecretsResetViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecretsResetViewState.swift; sourceTree = "<group>"; };
|
||||
B12676812523E4D100BE6B98 /* SecretsResetViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecretsResetViewAction.swift; sourceTree = "<group>"; };
|
||||
B12676822523E4D100BE6B98 /* SecretsResetViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecretsResetViewModel.swift; sourceTree = "<group>"; };
|
||||
B1284E3D2535FEA6003529D7 /* SecureBackupSetupIntroViewModelType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupSetupIntroViewModelType.swift; sourceTree = "<group>"; };
|
||||
B1284E3F2535FEBA003529D7 /* SecureBackupSetupIntroViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupSetupIntroViewModel.swift; sourceTree = "<group>"; };
|
||||
B12C56EE2396CB5E00FAC6DE /* RoomMessageURLParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMessageURLParser.swift; sourceTree = "<group>"; };
|
||||
B12D79F323E2462000FACEDC /* UserVerificationStartCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserVerificationStartCoordinator.swift; sourceTree = "<group>"; };
|
||||
B12D79F423E2462100FACEDC /* UserVerificationStartViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = UserVerificationStartViewController.storyboard; sourceTree = "<group>"; };
|
||||
|
@ -5062,6 +5066,8 @@
|
|||
EC711B9F24A63B58008F830C /* SecureBackupSetupIntroViewController.swift */,
|
||||
EC711BA024A63B58008F830C /* SecureBackupSetupIntroCell.swift */,
|
||||
EC711BA124A63B58008F830C /* SecureBackupSetupIntroViewController.storyboard */,
|
||||
B1284E3D2535FEA6003529D7 /* SecureBackupSetupIntroViewModelType.swift */,
|
||||
B1284E3F2535FEBA003529D7 /* SecureBackupSetupIntroViewModel.swift */,
|
||||
);
|
||||
path = Intro;
|
||||
sourceTree = "<group>";
|
||||
|
@ -6189,6 +6195,7 @@
|
|||
B157FAA023264AE900EBFBD4 /* SettingsDiscoveryThreePidDetailsViewModelType.swift in Sources */,
|
||||
B1B5573A20EE6C4D00210D55 /* GroupRoomsViewController.m in Sources */,
|
||||
B1B558F920EF768F00210D55 /* RoomOutgoingTextMsgWithoutSenderNameBubbleCell.m in Sources */,
|
||||
B1284E3E2535FEA6003529D7 /* SecureBackupSetupIntroViewModelType.swift in Sources */,
|
||||
B1FDF56021F5FE5500BA3834 /* KeyBackupSetupPassphraseViewAction.swift in Sources */,
|
||||
B1B5573120EE6C4D00210D55 /* BugReportViewController.m in Sources */,
|
||||
ECFBD5CB250A7AAF00DD5F5A /* DirectoryRoomTableViewCellVM.swift in Sources */,
|
||||
|
@ -6592,6 +6599,7 @@
|
|||
EC711B7624A63B37008F830C /* SecretsSetupRecoveryKeyViewState.swift in Sources */,
|
||||
32FDC1CD2386CD390084717A /* RiotSettingIntegrationProvisioning.swift in Sources */,
|
||||
B1BEE73523DF44A60003A4CB /* UserVerificationSessionsStatusViewModel.swift in Sources */,
|
||||
B1284E402535FEBA003529D7 /* SecureBackupSetupIntroViewModel.swift in Sources */,
|
||||
B1B5572020EE6C4D00210D55 /* ContactsTableViewController.m in Sources */,
|
||||
EC85D7142477DCD7002C44C9 /* KeyVerificationScanConfirmationViewState.swift in Sources */,
|
||||
EC711B9124A63B37008F830C /* SecretsRecoveryWithKeyCoordinatorType.swift in Sources */,
|
||||
|
@ -7277,7 +7285,7 @@
|
|||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1.0.16;
|
||||
CURRENT_PROJECT_VERSION = 1.0.17;
|
||||
DEFINES_MODULE = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
|
@ -7297,7 +7305,7 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MARKETING_VERSION = 1.0.16;
|
||||
MARKETING_VERSION = 1.0.17;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -7336,7 +7344,7 @@
|
|||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 1.0.16;
|
||||
CURRENT_PROJECT_VERSION = 1.0.17;
|
||||
DEFINES_MODULE = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -7349,7 +7357,7 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MARKETING_VERSION = 1.0.16;
|
||||
MARKETING_VERSION = 1.0.17;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
|
|
|
@ -227,6 +227,8 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
@property (nonatomic, weak) id userDidSignInOnNewDeviceObserver;
|
||||
@property (weak, nonatomic) UIAlertController *userNewSignInAlertController;
|
||||
|
||||
@property (nonatomic, weak) id userDidChangeCrossSigningKeysObserver;
|
||||
|
||||
/**
|
||||
Related push notification service instance. Will be created when launch finished.
|
||||
*/
|
||||
|
@ -1773,6 +1775,8 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
// Register to user new device sign in notification
|
||||
[self registerUserDidSignInOnNewDeviceNotificationForSession:mxSession];
|
||||
|
||||
[self registerDidChangeCrossSigningKeysNotificationForSession:mxSession];
|
||||
|
||||
// Register to new key verification request
|
||||
[self registerNewRequestNotificationForSession:mxSession];
|
||||
|
||||
|
@ -4224,9 +4228,11 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
|
||||
- (void)presentNewSignInAlertForDevice:(MXDevice*)device inSession:(MXSession*)session
|
||||
{
|
||||
NSLog(@"[AppDelegate] presentNewSignInAlertForDevice: %@", device.deviceId);
|
||||
|
||||
if (self.userNewSignInAlertController)
|
||||
{
|
||||
return;
|
||||
[self.userNewSignInAlertController dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
NSString *deviceInfo;
|
||||
|
@ -4242,7 +4248,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
|
||||
NSString *alertMessage = [NSString stringWithFormat:NSLocalizedStringFromTable(@"device_verification_self_verify_alert_message", @"Vector", nil), deviceInfo];
|
||||
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedStringFromTable(@"device_verification_self_verify_alert_title", @"Vector", nil)
|
||||
message:alertMessage
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
@ -4250,19 +4255,62 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"device_verification_self_verify_alert_validate_action", @"Vector", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
[self presentSelfVerificationForOtherDeviceId:device.deviceId inSession:session];
|
||||
}]];
|
||||
self.userNewSignInAlertController = nil;
|
||||
[self presentSelfVerificationForOtherDeviceId:device.deviceId inSession:session];
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"later", @"Vector", nil)
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
self.userNewSignInAlertController = nil;
|
||||
}]];
|
||||
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
|
||||
self.userNewSignInAlertController = alert;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Cross-signing reset detection
|
||||
|
||||
- (void)registerDidChangeCrossSigningKeysNotificationForSession:(MXSession*)session
|
||||
{
|
||||
MXCrossSigning *crossSigning = session.crypto.crossSigning;
|
||||
|
||||
if (!crossSigning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MXWeakify(self);
|
||||
|
||||
self.userDidChangeCrossSigningKeysObserver = [NSNotificationCenter.defaultCenter addObserverForName:MXCrossSigningDidChangeCrossSigningKeysNotification
|
||||
object:crossSigning
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification *notification)
|
||||
{
|
||||
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
NSLog(@"[AppDelegate] registerDidChangeCrossSigningKeysNotificationForSession");
|
||||
|
||||
if (self.userNewSignInAlertController)
|
||||
{
|
||||
NSLog(@"[AppDelegate] registerDidChangeCrossSigningKeysNotificationForSession: Hide NewSignInAlertController");
|
||||
|
||||
[self.userNewSignInAlertController dismissViewControllerAnimated:NO completion:^{
|
||||
[self.masterTabBarController presentVerifyCurrentSessionAlertIfNeededWithSession:session];
|
||||
}];
|
||||
self.userNewSignInAlertController = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.masterTabBarController presentVerifyCurrentSessionAlertIfNeededWithSession:session];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Complete security
|
||||
|
||||
- (BOOL)presentCompleteSecurityForSession:(MXSession*)mxSession
|
||||
|
|
|
@ -5209,6 +5209,11 @@
|
|||
|
||||
BOOL isCopyActionEnabled = !attachment || attachment.type != MXKAttachmentTypeSticker;
|
||||
|
||||
if (attachment && !BuildSettings.messageDetailsAllowCopyMedia)
|
||||
{
|
||||
isCopyActionEnabled = NO;
|
||||
}
|
||||
|
||||
if (isCopyActionEnabled)
|
||||
{
|
||||
switch (event.eventType) {
|
||||
|
|
|
@ -114,8 +114,8 @@ final class SecretsRecoveryCoordinator: SecretsRecoveryCoordinatorType {
|
|||
self.add(childCoordinator: coordinator)
|
||||
}
|
||||
|
||||
private func showSecureBackupSetup() {
|
||||
let coordinator = SecureBackupSetupCoordinator(session: self.session, navigationRouter: self.navigationRouter)
|
||||
private func showSecureBackupSetup(checkKeyBackup: Bool) {
|
||||
let coordinator = SecureBackupSetupCoordinator(session: self.session, checkKeyBackup: checkKeyBackup, navigationRouter: self.navigationRouter)
|
||||
coordinator.delegate = self
|
||||
coordinator.start()
|
||||
|
||||
|
@ -165,7 +165,7 @@ extension SecretsRecoveryCoordinator: SecretsRecoveryWithPassphraseCoordinatorDe
|
|||
// MARK: - SecretsResetCoordinatorDelegate
|
||||
extension SecretsRecoveryCoordinator: SecretsResetCoordinatorDelegate {
|
||||
func secretsResetCoordinatorDidResetSecrets(_ coordinator: SecretsResetCoordinatorType) {
|
||||
self.showSecureBackupSetup()
|
||||
self.showSecureBackupSetup(checkKeyBackup: false)
|
||||
}
|
||||
|
||||
func secretsResetCoordinatorDidCancel(_ coordinator: SecretsResetCoordinatorType) {
|
||||
|
|
|
@ -38,6 +38,7 @@ final class SecureBackupSetupIntroViewController: UIViewController {
|
|||
|
||||
// MARK: Private
|
||||
|
||||
private var viewModel: SecureBackupSetupIntroViewModelType!
|
||||
private var theme: Theme!
|
||||
|
||||
private var activityIndicatorPresenter: ActivityIndicatorPresenter!
|
||||
|
@ -47,14 +48,11 @@ final class SecureBackupSetupIntroViewController: UIViewController {
|
|||
|
||||
weak var delegate: SecureBackupSetupIntroViewControllerDelegate?
|
||||
|
||||
// This is evil
|
||||
// TODO: refactor it
|
||||
weak var keyBackup: MXKeyBackup?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
class func instantiate() -> SecureBackupSetupIntroViewController {
|
||||
class func instantiate(with viewModel: SecureBackupSetupIntroViewModelType) -> SecureBackupSetupIntroViewController {
|
||||
let viewController = StoryboardScene.SecureBackupSetupIntroViewController.initialScene.instantiate()
|
||||
viewController.viewModel = viewModel
|
||||
viewController.theme = ThemeService.shared().theme
|
||||
return viewController
|
||||
}
|
||||
|
@ -162,7 +160,11 @@ final class SecureBackupSetupIntroViewController: UIViewController {
|
|||
|
||||
// TODO: To remove
|
||||
private func checkKeyBackup() {
|
||||
guard let keyBackup = self.keyBackup else {
|
||||
guard self.viewModel.checkKeyBackup else {
|
||||
return
|
||||
}
|
||||
|
||||
guard let keyBackup = self.viewModel.keyBackup else {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -194,8 +196,9 @@ final class SecureBackupSetupIntroViewController: UIViewController {
|
|||
}
|
||||
}
|
||||
|
||||
func deleteKeybackup() {
|
||||
guard let keyBackup = self.keyBackup, let keybackupVersion = keyBackup.keyBackupVersion?.version else {
|
||||
// TODO: Move to view model
|
||||
private func deleteKeybackup() {
|
||||
guard let keyBackup = self.viewModel.keyBackup, let keybackupVersion = keyBackup.keyBackupVersion?.version else {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// Copyright 2020 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
final class SecureBackupSetupIntroViewModel: SecureBackupSetupIntroViewModelType {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// TODO: Make these properties private
|
||||
let keyBackup: MXKeyBackup?
|
||||
let checkKeyBackup: Bool
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(keyBackup: MXKeyBackup?, checkKeyBackup: Bool) {
|
||||
self.keyBackup = keyBackup
|
||||
self.checkKeyBackup = checkKeyBackup
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// Copyright 2020 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Protocol describing the view model used by `SecureBackupSetupIntroViewController`
|
||||
protocol SecureBackupSetupIntroViewModelType {
|
||||
|
||||
// TODO: Hide these properties from interface and use same behavior as other view models
|
||||
var keyBackup: MXKeyBackup? { get }
|
||||
var checkKeyBackup: Bool { get }
|
||||
}
|
|
@ -29,6 +29,7 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
|
|||
private let session: MXSession
|
||||
private let recoveryService: MXRecoveryService
|
||||
private let keyBackup: MXKeyBackup?
|
||||
private let checkKeyBackup: Bool
|
||||
|
||||
// MARK: Public
|
||||
|
||||
|
@ -39,10 +40,16 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
|
|||
|
||||
// MARK: - Setup
|
||||
|
||||
init(session: MXSession, navigationRouter: NavigationRouterType? = nil) {
|
||||
/// Initializer
|
||||
/// - Parameters:
|
||||
/// - session: The MXSession.
|
||||
/// - checkKeyBackup: Indicate false to ignore existing key backup.
|
||||
/// - navigationRouter: Use existing navigation router to plug this flow or let nil to use new one.
|
||||
init(session: MXSession, checkKeyBackup: Bool = true, navigationRouter: NavigationRouterType? = nil) {
|
||||
self.session = session
|
||||
self.recoveryService = session.crypto.recoveryService
|
||||
self.keyBackup = session.crypto.backup
|
||||
self.checkKeyBackup = checkKeyBackup
|
||||
|
||||
if let navigationRouter = navigationRouter {
|
||||
self.navigationRouter = navigationRouter
|
||||
|
@ -70,9 +77,10 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
|
|||
// MARK: - Private methods
|
||||
|
||||
private func createIntro() -> SecureBackupSetupIntroViewController {
|
||||
let introViewController = SecureBackupSetupIntroViewController.instantiate()
|
||||
// TODO: Use a coordinator
|
||||
let viewModel = SecureBackupSetupIntroViewModel(keyBackup: self.keyBackup, checkKeyBackup: self.checkKeyBackup)
|
||||
let introViewController = SecureBackupSetupIntroViewController.instantiate(with: viewModel)
|
||||
introViewController.delegate = self
|
||||
introViewController.keyBackup = self.keyBackup
|
||||
return introViewController
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue