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

show scanned qr-code texts, tweak join questions

B. Petersen пре 5 година
родитељ
комит
e0e1c15455
2 измењених фајлова са 12 додато и 8 уклоњено
  1. 11 4
      deltachat-ios/Controller/QrViewController.swift
  2. 1 4
      tools/untranslated.xml

+ 11 - 4
deltachat-ios/Controller/QrViewController.swift

@@ -140,11 +140,18 @@ class QrViewController: UITableViewController, QrCodeReaderDelegate {
         switch state {
         switch state {
         case DC_QR_ASK_VERIFYCONTACT:
         case DC_QR_ASK_VERIFYCONTACT:
             let nameAndAddress = DcContact(id: qrParsed.id).nameNAddr
             let nameAndAddress = DcContact(id: qrParsed.id).nameNAddr
-            joinSecureJoin(alertMessage: String.localizedStringWithFormat(String.localized("qrscan_ask_fingerprint_ask_oob"), nameAndAddress), code: code)
+            joinSecureJoin(alertMessage: String.localizedStringWithFormat(String.localized("ask_start_chat_with"), nameAndAddress), code: code)
+
         case DC_QR_ASK_VERIFYGROUP:
         case DC_QR_ASK_VERIFYGROUP:
-            if let group = qrParsed.text1?.replacingOccurrences(of: "+", with: " ") {
-                joinSecureJoin(alertMessage: String.localizedStringWithFormat(String.localized("qrscan_ask_join_group"), group), code: code)
-            }
+            let groupName = qrParsed.text1 ?? "ErrGroupName"
+            joinSecureJoin(alertMessage: String.localizedStringWithFormat(String.localized("qrscan_ask_join_group"), groupName), code: code)
+
+        case DC_QR_TEXT:
+            let msg = String.localizedStringWithFormat(String.localized("qrscan_contains_text"), qrParsed.text1 ?? "")
+            let alert = UIAlertController(title: msg, message: nil, preferredStyle: .alert)
+            alert.addAction(UIAlertAction(title: String.localized("ok"), style: .default, handler: nil))
+            present(alert, animated: true, completion: nil)
+
         default:
         default:
             var msg = String.localizedStringWithFormat(String.localized("qrscan_contains_text"), code)
             var msg = String.localizedStringWithFormat(String.localized("qrscan_contains_text"), code)
             if state == DC_QR_ERROR {
             if state == DC_QR_ERROR {

+ 1 - 4
tools/untranslated.xml

@@ -2,14 +2,11 @@
 <resources>
 <resources>
 
 
     <!-- iOS specific untranslated strings -->
     <!-- iOS specific untranslated strings -->
-    <string name="hide">Hide</string>
-    <string name="start_chat">Start Chat</string>
+    <string name="start_chat">Start chat</string>
     <string name="dismiss">Dismiss</string>
     <string name="dismiss">Dismiss</string>
     <string name="photo">Photo</string>
     <string name="photo">Photo</string>
     <string name="import_contacts">Import device contacts</string>
     <string name="import_contacts">Import device contacts</string>
     <string name="import_contacts_message">To chat with contacts from your device open the settings menu and enable the Contacts option</string>
     <string name="import_contacts_message">To chat with contacts from your device open the settings menu and enable the Contacts option</string>
-    <string name="synchronizing_account">Synchronizing account</string>
-    <string name="invalid_qr_code">Invalid group QR code</string>
     <string name="no_account_setup">No account set up</string>
     <string name="no_account_setup">No account set up</string>
     <string name="delete_account">Delete account</string>
     <string name="delete_account">Delete account</string>
     <string name="delete_account_message">Are you sure you want to delete your account data?</string>
     <string name="delete_account_message">Are you sure you want to delete your account data?</string>