|
@@ -140,17 +140,28 @@ class QrViewController: UITableViewController, QrCodeReaderDelegate {
|
|
|
switch state {
|
|
|
case DC_QR_ASK_VERIFYCONTACT:
|
|
|
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:
|
|
|
- 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:
|
|
|
- let alertMessage = "QR code scanning for type " + String(state) + " is not yet implemented."
|
|
|
- let alert = UIAlertController(title: alertMessage,
|
|
|
- message: nil,
|
|
|
- preferredStyle: .alert)
|
|
|
+ var msg = String.localizedStringWithFormat(String.localized("qrscan_contains_text"), code)
|
|
|
+ if state == DC_QR_ERROR {
|
|
|
+ if let errorMsg = qrParsed.text1 {
|
|
|
+ msg = errorMsg + "\n\n" + msg
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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)
|
|
|
}
|
|
|
|
|
|
}
|