diff options
author | Thorben Günther <admin@xenrox.net> | 2021-03-11 14:38:27 +0100 |
---|---|---|
committer | Thorben Günther <admin@xenrox.net> | 2021-03-11 14:40:17 +0100 |
commit | 71236a0d5a47277d55caa5a09befa97ccabe7fec (patch) | |
tree | 5d2a3585322f72bad73060fa4fce59afadd6d8f5 /src/ui | |
parent | 96580f917b5c0a061e7bf41714cf48c8e89cd5f8 (diff) | |
download | profani-tty-71236a0d5a47277d55caa5a09befa97ccabe7fec.tar.gz |
Update ui_ask_password to support confirmation
Just prints a different string to console. Useful for changing passwords or account registration.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/core.c | 8 | ||||
-rw-r--r-- | src/ui/ui.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 5021ac72..931417c4 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -993,9 +993,13 @@ ui_win_unread(int index) } char* -ui_ask_password(void) +ui_ask_password(gboolean confirm) { - status_bar_set_prompt("Enter password:"); + if (!confirm) { + status_bar_set_prompt("Enter password:"); + } else { + status_bar_set_prompt("Confirm password:"); + } return inp_get_password(); } diff --git a/src/ui/ui.h b/src/ui/ui.h index 8ce27840..391b906c 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -75,7 +75,7 @@ int ui_close_all_wins(void); int ui_close_read_wins(void); void ui_close_win(int index); int ui_win_unread(int index); -char* ui_ask_password(void); +char* ui_ask_password(gboolean confirm); char* ui_get_line(void); char* ui_ask_pgp_passphrase(const char* hint, int prev_fail); void ui_contact_online(char* barejid, Resource* resource, GDateTime* last_activity); |