From 7b918bd4955cb2a0324a51126500a26606fffbd7 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 9 Aug 2024 23:44:45 +0200 Subject: [PATCH] support DC_QR_BACKUP2 BACKUP2-qr-codes are generated by newer cores, they of course should also be supported when scanning QR codes. --- .../Controller/AccountSetup/WelcomeViewController.swift | 2 +- deltachat-ios/Controller/QrPageController.swift | 2 +- deltachat-ios/Coordinator/AppCoordinator.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift b/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift index f4719fabb..b6aae2e7b 100644 --- a/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift +++ b/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift @@ -233,7 +233,7 @@ class WelcomeViewController: UIViewController { extension WelcomeViewController: QrCodeReaderDelegate { func handleQrCode(_ code: String) { let lot = dcContext.checkQR(qrCode: code) - if lot.state == DC_QR_BACKUP { + if lot.state == DC_QR_BACKUP || lot.state == DC_QR_BACKUP2 { confirmSetupNewDevice(qrCode: code) } else { qrErrorAlert() diff --git a/deltachat-ios/Controller/QrPageController.swift b/deltachat-ios/Controller/QrPageController.swift index 0ef2e456d..d8ae30654 100644 --- a/deltachat-ios/Controller/QrPageController.swift +++ b/deltachat-ios/Controller/QrPageController.swift @@ -292,7 +292,7 @@ extension QrPageController: QrCodeReaderDelegate { })) present(alert, animated: true, completion: nil) - case DC_QR_BACKUP: + case DC_QR_BACKUP, DC_QR_BACKUP2: // alert is shown in WelcomeViewController guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return } _ = dcAccounts.add() diff --git a/deltachat-ios/Coordinator/AppCoordinator.swift b/deltachat-ios/Coordinator/AppCoordinator.swift index 80e823589..2ebf1e1a7 100644 --- a/deltachat-ios/Coordinator/AppCoordinator.swift +++ b/deltachat-ios/Coordinator/AppCoordinator.swift @@ -236,7 +236,7 @@ class AppCoordinator: NSObject { if let accountCode { let qr = dcAccounts.getSelected().checkQR(qrCode: accountCode) - if qr.state == DC_QR_BACKUP { + if qr.state == DC_QR_BACKUP || qr.state == DC_QR_BACKUP2 { viewControllers = [WelcomeViewController(dcAccounts: dcAccounts, accountCode: accountCode)] } else { viewControllers = [