diff options
author | swirl <swurl@swurl.xyz> | 2022-05-27 15:25:28 -0400 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2022-05-30 18:04:42 +0200 |
commit | 9a9a97868d0366408d7a310de3fa7158a294854e (patch) | |
tree | 74641d809f9f8f52b3d3507eb1fcc84b52c6c08a /src/command | |
parent | cf83976b51dd103a17b75dd77f326f64166199bc (diff) | |
download | profani-tty-9a9a97868d0366408d7a310de3fa7158a294854e.tar.gz |
implement working OMEMO QR code
TODO: We need to find a way to switch the colors of the QR code, so that more QR readers can detect it, without "blending" the edges of the QR code with the surrounding terminal window. Signed-off-by: swirl <swurl@swurl.xyz>
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/cmd_funcs.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 29c8a29a..81293c15 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9039,7 +9039,18 @@ gboolean cmd_omemo_qrcode(ProfWin* window, const char* const command, gchar** args) { #ifdef HAVE_OMEMO - cons_show_omemo_qrcode("some text from me"); + if (connection_get_status() != JABBER_CONNECTED) { + cons_show("You must be connected with an account to load OMEMO information."); + return TRUE; + } + + if (!omemo_loaded()) { + win_println(window, THEME_DEFAULT, "!", "You have not generated or loaded a cryptographic materials, use '/omemo gen'"); + return TRUE; + } + + char* fingerprint = omemo_own_fingerprint(TRUE); + cons_show_omemo_qrcode(fingerprint); return TRUE; #else cons_show("This version of Profanity has not been built with OMEMO support enabled"); @@ -9767,3 +9778,4 @@ cmd_mood(ProfWin* window, const char* const command, gchar** args) } return TRUE; } + |