Skip to content

Commit

Permalink
Hide the session verification based on the secure storage (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Loriaux committed Apr 1, 2022
1 parent 44a6e15 commit 6112feb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
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
6 changes: 6 additions & 0 deletions 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 Down Expand Up @@ -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 6112feb

Please sign in to comment.