From 9414ad268d79ba3d0e75ef5fbe0e379c4462893d Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 22 Sep 2015 21:42:05 +0100 Subject: Prompt user to allow or deny untrusted TLS certificates --- src/ui/core.c | 7 +++++++ src/ui/inputwin.c | 16 ++++++++++++++++ src/ui/inputwin.h | 1 + src/ui/ui.h | 1 + 4 files changed, 25 insertions(+) (limited to 'src/ui') diff --git a/src/ui/core.c b/src/ui/core.c index 5735f462..9f7ffcd7 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -2106,6 +2106,13 @@ ui_ask_password(void) return inp_get_password(); } +char * +ui_get_line(void) +{ + status_bar_update_virtual(); + return inp_get_line(); +} + char * ui_ask_pgp_passphrase(const char *hint, int prev_fail) { diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 9b4eddfb..5ab2c281 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -225,6 +225,21 @@ inp_close(void) rl_callback_handler_remove(); } +char * +inp_get_line(void) +{ + werase(inp_win); + wmove(inp_win, 0, 0); + _inp_win_update_virtual(); + doupdate(); + char *line = NULL; + while (!line) { + line = inp_readline(); + } + status_bar_clear(); + return line; +} + char* inp_get_password(void) { @@ -275,6 +290,7 @@ _inp_write(char *line, int offset) _inp_win_handle_scroll(); _inp_win_update_virtual(); + doupdate(); } static int diff --git a/src/ui/inputwin.h b/src/ui/inputwin.h index f49a6a76..4f732e67 100644 --- a/src/ui/inputwin.h +++ b/src/ui/inputwin.h @@ -47,5 +47,6 @@ void inp_win_clear(void); void inp_win_resize(void); void inp_put_back(void); char* inp_get_password(void); +char * inp_get_line(void); #endif diff --git a/src/ui/ui.h b/src/ui/ui.h index 27395048..07cccd20 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -102,6 +102,7 @@ win_type_t ui_win_type(int index); void ui_close_win(int index); int ui_win_unread(int index); char * ui_ask_password(void); +char * ui_get_line(void); char * ui_ask_pgp_passphrase(const char *hint, int prev_fail); void ui_handle_stanza(const char * const msg); -- cgit 1.4.1-2-gfad0