From 6034b833be41909982b0d2bdac0a1d8499ad8e76 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 20 Feb 2019 12:03:23 +0100 Subject: Redraw screen after entry of PGP secret key After specifying the PGP key ID with pgp.keyid within the accounts file on startup profanity asks for the secret key passphrase. It then doesn't redraw the screen, leaving it in an odd looking state. This probably only happens with pinentry-curses since it draws in screen. We need this fix for cli only environments. Fixes https://github.com/boothj5/profanity/issues/906 reported by Bob Mottram. Based on https://github.com/boothj5/profanity/pull/908 by Bob Mottram Bob removed his GitHub account, so GitHub created a ghost placeholder user for him, which unfortunately makes it impossible to cherry-pick this commit. To more or less preserve authorship I added him as co-author. Commit picked and message edited by jubalh. Co-authored-by: Bob Mottram --- src/event/server_events.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/event/server_events.c b/src/event/server_events.c index 5dfa652f..69883141 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -118,6 +118,16 @@ sv_ev_roster_received(void) cons_show_error("Invalid PGP key ID specified: %s, %s", account->pgp_keyid, err_str); } free(err_str); + + // Redraw the screen after entry of the PGP secret key + ProfWin *win = wins_get_current(); + char *theme = prefs_get_string(PREF_THEME); + win_clear(win); + theme_init(theme); + prefs_free_string(theme); + ui_init(); + ui_resize(); + ui_show_roster(); } account_free(account); #endif -- cgit 1.4.1-2-gfad0