mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-22 12:19:55 +00:00
Recognise wrong QR code type in every scanner
When a scanner is shown a QR code of a different kind than it expects, it now tells the user what they actually scanned and where to use it, instead of a generic "invalid" message. Link recognition is done in the core: a new chat_check_link export classifies a scanned string using the same decoders the views use to process the links (connection link, server address, migration file link, desktop address, security code), returning a typed result. Each scanner calls checkLink first; the expected type proceeds to that scanner's normal success path, a recognised-but-wrong type shows a shared wrong-type alert saying what it is and where to use it, and an unrecognised string falls back to that scanner's own contextual error. Mirrored on Android, desktop and iOS. Note: the iOS Swift was written without an Xcode toolchain and is not yet compiled — needs a Mac/CI build to verify.
This commit is contained in:
@@ -12,6 +12,7 @@ EXPORTS
|
||||
chat_recv_msg_wait
|
||||
chat_parse_markdown
|
||||
chat_parse_server
|
||||
chat_check_link
|
||||
chat_parse_uri
|
||||
chat_password_hash
|
||||
chat_valid_name
|
||||
|
||||
Reference in New Issue
Block a user