-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: create QR codes from any data (#6090)
this PR adds a function that can be used to create any QR code, in a raw form. this can be used to create add-contact as well as add-second-device QR codes (eg. `dc_create_qr_svg(dc_get_securejoin_qr())`) - as well as for other QR codes as proxies. the disadvantage of the rich-formatted QR codes as created by `dc_get_securejoin_qr_svg()` and `dc_backup_provider_get_qr_svg()` were: - they do not look good and cannot interact with UI layout wise (but also tapping eg. an address is not easily possible) - esp. text really looks bad. even with [some](deltachat/deltachat-android@e5dc8fe) [hacks](deltachat/deltachat-android#2215) it [stays buggy](deltachat/deltachat-ios#2200); the bugs mainly come from different SVG implementation, all need their own quirks - accessibility is probably bad as well we thought that time, SVG is a great thing for QR codes, but apart from basic geometrics, it is not. so, we avoid text, this also means to avoid putting an avatar in the middle of the QR code (we can put some generic symbol there, eg. different ones for add-contact and add-second-device). while this looks like a degradation, also other messengers use more raw QR codes. also, we removed many data from the QR code anyway, eg. the email address is no longer there. that time, sharing QR images was more a thing, meanwhile we have invite links, that are much better for that purpose. in theory, we could also leave the SVG path completely and go for PNG - which we did not that time as PNG and text looks bad, as the system font is not easily usable :) but going for PNG would add further challenges as passing binary data around, and also UI-implemtation-wise, that would be a larger step. so, let's stay with SVG in a form we know is compatible. the old QR code functions are deprecated.
- Loading branch information
Showing
5 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters