MESSENGER-4093 scan permalinks as qr

This commit is contained in:
Arnfried Griesert
2023-02-23 06:50:16 +00:00
committed by Frank Rotermund
parent 1bff461abb
commit eb618b395d
15 changed files with 325 additions and 127 deletions
@@ -1917,6 +1917,28 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
[self performSegueWithIdentifier:@"presentStartChat" sender:self];
}
- (void)scanPermalink {
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if(authStatus == AVAuthorizationStatusDenied) {
UIAlertController* alert = [UIAlertController alertControllerWithTitle:BWIL10n.authenticationServerSelectionQrMissingAuthorizationTitle
message:BWIL10n.authenticationServerSelectionQrMissingAuthorizationMessage
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* primaryAction = [UIAlertAction actionWithTitle:VectorL10n.settingsTitle style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[[UIApplication sharedApplication] openURL: [NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
}];
UIAlertAction* secondaryAction = [UIAlertAction actionWithTitle:VectorL10n.cancel style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {}];
[alert addAction:primaryAction];
[alert addAction:secondaryAction];
[self presentViewController:alert animated:YES completion:nil];
} else {
UIViewController* viewController = [PermalinkQRCodeScannerController createFromSwiftUIView];
[self presentViewController:viewController animated: YES completion: nil];
}
}
- (void)createNewRoom
{
// Sanity check