about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-02-20 12:03:23 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-02-20 12:03:23 +0100
commit6034b833be41909982b0d2bdac0a1d8499ad8e76 (patch)
treee1623741ba5d8b509d94819e22deb4aadb3f8526
parent289b05ea5015ee38fe105839a7ad806678f38f15 (diff)
downloadprofani-tty-6034b833be41909982b0d2bdac0a1d8499ad8e76.tar.gz
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 <bob@freedombone.net>
-rw-r--r--src/event/server_events.c10
1 files changed, 10 insertions, 0 deletions
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