Skip to content

Commit

Permalink
Merge pull request #494 from tchapgouv/phlpro/486
Browse files Browse the repository at this point in the history
Hide the session verification based on the secure storage (#486)
  • Loading branch information
Phl-Pro authored Apr 4, 2022
2 parents 44a6e15 + b4eb748 commit 7aaeb69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -3574,6 +3574,8 @@ - (void)disableNoVoIPOnMatrixSession:(MXSession*)mxSession

- (void)checkCrossSigningForSession:(MXSession*)mxSession
{
// Tchap: Disable Cross Signing Managment.
#ifdef SUPPORT_KEYS_BACKUP
if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive)
{
MXLogDebug(@"[AppDelegate] checkCrossSigningForSession called while the app is not active. Ignore it.");
Expand Down Expand Up @@ -3606,6 +3608,7 @@ - (void)checkCrossSigningForSession:(MXSession*)mxSession
MXLogDebug(@"[AppDelegate] handleAppState: crossSigning.state: %@. Error: %@", @(mxSession.crypto.crossSigning.state), error);
}];
}
#endif
}


Expand Down Expand Up @@ -4248,6 +4251,8 @@ - (void)presentNewSignInAlertForDevice:(MXDevice*)device inSession:(MXSession*)s

- (void)registerDidChangeCrossSigningKeysNotificationForSession:(MXSession*)session
{
// Tchap: Disable Cross Signing Managment.
#ifdef SUPPORT_KEYS_BACKUP
MXCrossSigning *crossSigning = session.crypto.crossSigning;

if (!crossSigning)
Expand Down Expand Up @@ -4281,6 +4286,7 @@ - (void)registerDidChangeCrossSigningKeysNotificationForSession:(MXSession*)sess
[self.masterTabBarController presentVerifyCurrentSessionAlertIfNeededWithSession:session];
}
}];
#endif
}


Expand Down
8 changes: 7 additions & 1 deletion Riot/Modules/TabBar/MasterTabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,8 @@ - (void)promptUserBeforeUsingAnalyticsForSession:(MXSession *)mxSession

- (void)presentVerifyCurrentSessionAlertIfNeededWithSession:(MXSession*)session
{
// Tchap: Disable Cross Signing Managment.
#ifdef SUPPORT_KEYS_BACKUP
if (RiotSettings.shared.hideVerifyThisSessionAlert
|| self.reviewSessionAlertHasBeenDisplayed
|| self.isOnboardingInProgress)
Expand All @@ -979,10 +981,13 @@ - (void)presentVerifyCurrentSessionAlertIfNeededWithSession:(MXSession*)session

self.reviewSessionAlertHasBeenDisplayed = YES;
[self presentVerifyCurrentSessionAlertWithSession:session];
#endif
}

- (void)presentVerifyCurrentSessionAlertWithSession:(MXSession*)session
{
// Tchap: Disable Cross Signing Managment.
#ifdef SUPPORT_KEYS_BACKUP
MXLogDebug(@"[MasterTabBarController] presentVerifyCurrentSessionAlertWithSession");

[currentAlert dismissViewControllerAnimated:NO completion:nil];
Expand All @@ -994,7 +999,7 @@ - (void)presentVerifyCurrentSessionAlertWithSession:(MXSession*)session
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n keyVerificationSelfVerifyCurrentSessionAlertValidateAction]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
// [[AppDelegate theDelegate] presentCompleteSecurityForSession:session];
[[AppDelegate theDelegate] presentCompleteSecurityForSession:session];
}]];

[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n later]
Expand All @@ -1011,6 +1016,7 @@ - (void)presentVerifyCurrentSessionAlertWithSession:(MXSession*)session
[self presentViewController:alert animated:YES completion:nil];

currentAlert = alert;
#endif
}

- (void)presentReviewUnverifiedSessionsAlertIfNeededWithSession:(MXSession*)session
Expand Down
1 change: 1 addition & 0 deletions changelog.d/486.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide the session verification based on the secure storage

0 comments on commit 7aaeb69

Please sign in to comment.