Преглед изворни кода

add alert after successful qr code scan asking to chat with a contact

cyberta пре 6 година
родитељ
комит
502b9d1ce3
1 измењених фајлова са 14 додато и 3 уклоњено
  1. 14 3
      deltachat-ios/Controller/NewProfileViewController.swift

+ 14 - 3
deltachat-ios/Controller/NewProfileViewController.swift

@@ -175,9 +175,20 @@ class NewProfileViewController: UIViewController, QrCodeReaderDelegate {
         if let ctrl = navigationController {
             ctrl.viewControllers.removeLast()
         }
-        DispatchQueue.main.async {
-            self.dcContext.joinSecurejoin(qrCode: code)
-        }
+
+        let qrParsed: DcLot = self.dcContext.checkQR(qrCode: code)
+        let nameAndAddress = DCContact(id: qrParsed.id).nameNAddr;
+
+        let alert = UIAlertController(title: String.localizedStringWithFormat(String.localized("qrscan_ask_fingerprint_ask_oob"), nameAndAddress), message: nil, preferredStyle: .alert)
+        alert.addAction(UIAlertAction(title: String.localized("ok"), style: .default, handler: { _ in
+            DispatchQueue.main.async {
+                // TODO: write something useeeeful here :P
+
+                }
+            self.dismiss(animated: true, completion: nil)
+
+        }))
+        present(alert, animated: true, completion: nil)
     }
 
     private func createInfoLabel() -> UIView {