Self-verification: Fix compatibility with Element-Web when logging in on web

#4217

If web triggers a verification request (because the users clicked on "Use another login"), remove the newSignIn alert dialog before display the incoming verification request.
This commit is contained in:
manuroe
2021-04-14 18:50:37 +02:00
parent 9264128a8e
commit 3eabba310e
+14 -1
View File
@@ -3934,6 +3934,18 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[self.incomingKeyVerificationRequestAlertController dismissViewControllerAnimated:NO completion:nil];
}
if (self.userNewSignInAlertController
&& [session.myUserId isEqualToString:senderId])
{
// If it is a self verification for my device, we can discard the new signin alert.
// Note: It will not work well with several devices to verify at the same time.
NSLog(@"[AppDelegate] presentNewKeyVerificationRequest: Remove the alert for new sign in detected");
[self.userNewSignInAlertController dismissViewControllerAnimated:NO completion:^{
self.userNewSignInAlertController = nil;
[self presentNewKeyVerificationRequestAlertForSession:session senderName:senderName senderId:senderId request:keyVerificationRequest];
}];
}
NSString *senderInfo;
if (senderName)
@@ -3955,7 +3967,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
}
};
/// ooo
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedStringFromTable(@"key_verification_tile_request_incoming_title", @"Vector", nil)
message:senderInfo
preferredStyle:UIAlertControllerStyleAlert];
@@ -4093,6 +4105,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[self presentViewController:alert animated:YES completion:nil];
//// ooo
self.userNewSignInAlertController = alert;
}