Merge pull request #2372 from vector-im/riot_2323

E2E: SAS Verification
This commit is contained in:
manuroe
2019-04-24 14:51:04 +02:00
committed by GitHub
60 changed files with 4631 additions and 260 deletions
@@ -48,8 +48,6 @@
#import "Riot-Swift.h"
#import "EncryptionInfoView.h"
NSString* const kSettingsViewControllerPhoneBookCountryCellId = @"kSettingsViewControllerPhoneBookCountryCellId";
enum
@@ -4351,68 +4349,6 @@ SignOutAlertPresenterDelegate>
[[AppDelegate theDelegate] showErrorAsAlert:error];
}
#pragma mark - MXKEncryptionInfoView
- (void)showDeviceInfo:(MXDeviceInfo*)deviceInfo
{
// Show it modally on the root view controller
// TODO: Improve it
UIViewController *rootViewController = [AppDelegate theDelegate].window.rootViewController;
if (rootViewController)
{
EncryptionInfoView *encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:deviceInfo andMatrixSession:self.mainSession];
[encryptionInfoView onButtonPressed:encryptionInfoView.verifyButton];
encryptionInfoView.delegate = self;
// Add shadow on added view
encryptionInfoView.layer.cornerRadius = 5;
encryptionInfoView.layer.shadowOffset = CGSizeMake(0, 1);
encryptionInfoView.layer.shadowOpacity = 0.5f;
// Add the view and define edge constraints
[rootViewController.view addSubview:encryptionInfoView];
[rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:rootViewController.topLayoutGuide
attribute:NSLayoutAttributeBottom
multiplier:1.0f
constant:10.0f]];
[rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:rootViewController.bottomLayoutGuide
attribute:NSLayoutAttributeTop
multiplier:1.0f
constant:-10.0f]];
[rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:rootViewController.view
attribute:NSLayoutAttributeLeading
relatedBy:NSLayoutRelationEqual
toItem:encryptionInfoView
attribute:NSLayoutAttributeLeading
multiplier:1.0f
constant:-10.0f]];
[rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:rootViewController.view
attribute:NSLayoutAttributeTrailing
relatedBy:NSLayoutRelationEqual
toItem:encryptionInfoView
attribute:NSLayoutAttributeTrailing
multiplier:1.0f
constant:10.0f]];
[rootViewController.view setNeedsUpdateConstraints];
}
}
- (void)encryptionInfoView:(MXKEncryptionInfoView*)encryptionInfoView didDeviceInfoVerifiedChange:(MXDeviceInfo*)deviceInfo
{
[keyBackupSection reload];
}
#pragma mark - KeyBackupRecoverCoordinatorBridgePresenter
- (void)showKeyBackupSetupFromSignOutFlow:(BOOL)showFromSignOutFlow