fix(ui): guard terminal writes while suspended
We forgot to guard `beep()` and `flush()`. Ref:36ec2b0ae1Ref:dd76f9087fSigned-off-by: Michael Vetter <jubalh@iodoru.org> Fixes: https://github.com/profanity-im/profanity/issues/2162 (cherry picked from commit 5e4b5d313a9e055e039e2feb4efae58b6aaead78)
This commit is contained in:
@@ -341,7 +341,7 @@ sv_ev_room_message(ProfMessage* message)
|
||||
status_bar_active(num, WIN_MUC, mucwin->roomjid);
|
||||
|
||||
if ((g_strcmp0(mynick, message->from_jid->resourcepart) != 0) && (prefs_get_boolean(PREF_BEEP))) {
|
||||
beep();
|
||||
ui_beep();
|
||||
}
|
||||
|
||||
// not currently on groupchat window
|
||||
@@ -349,7 +349,7 @@ sv_ev_room_message(ProfMessage* message)
|
||||
status_bar_new(num, WIN_MUC, mucwin->roomjid);
|
||||
|
||||
if ((g_strcmp0(mynick, message->from_jid->resourcepart) != 0) && (prefs_get_boolean(PREF_FLASH))) {
|
||||
flash();
|
||||
ui_flash();
|
||||
}
|
||||
|
||||
cons_show_incoming_room_message(message->from_jid->resourcepart, mucwin->roomjid, num, mention, triggers, mucwin->unread, window);
|
||||
|
||||
@@ -327,7 +327,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
|
||||
cons_show_incoming_message(display_name, num, chatwin->unread, window);
|
||||
|
||||
if (prefs_get_boolean(PREF_FLASH)) {
|
||||
flash();
|
||||
ui_flash();
|
||||
}
|
||||
|
||||
chatwin->unread++;
|
||||
@@ -364,7 +364,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
|
||||
wins_add_quotes_ac(window, message->plain, FALSE);
|
||||
|
||||
if (prefs_get_boolean(PREF_BEEP)) {
|
||||
beep();
|
||||
ui_beep();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ void
|
||||
ui_suspend(void)
|
||||
{
|
||||
inp_suspend();
|
||||
doupdate();
|
||||
endwin();
|
||||
}
|
||||
|
||||
@@ -190,6 +191,22 @@ ui_resume(void)
|
||||
inp_resume();
|
||||
}
|
||||
|
||||
void
|
||||
ui_beep(void)
|
||||
{
|
||||
if (!isendwin()) {
|
||||
beep();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ui_flash(void)
|
||||
{
|
||||
if (!isendwin()) {
|
||||
flash();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ui_resize(void)
|
||||
{
|
||||
|
||||
@@ -459,7 +459,9 @@ _inp_write(char* line, int offset)
|
||||
_inp_win_handle_scroll();
|
||||
|
||||
_inp_win_update_virtual();
|
||||
doupdate();
|
||||
if (!isendwin()) {
|
||||
doupdate();
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -57,7 +57,7 @@ privwin_incoming_msg(ProfPrivateWin* privatewin, ProfMessage* message)
|
||||
privatewin->unread++;
|
||||
|
||||
if (prefs_get_boolean(PREF_FLASH)) {
|
||||
flash();
|
||||
ui_flash();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ privwin_incoming_msg(ProfPrivateWin* privatewin, ProfMessage* message)
|
||||
wins_add_quotes_ac(window, message->plain, TRUE);
|
||||
|
||||
if (prefs_get_boolean(PREF_BEEP)) {
|
||||
beep();
|
||||
ui_beep();
|
||||
}
|
||||
|
||||
if (notify) {
|
||||
|
||||
@@ -84,6 +84,8 @@ void ui_handle_recipient_error(const char* const recipient, const char* const er
|
||||
void ui_handle_error(const char* const err_msg);
|
||||
void ui_clear_win_title(void);
|
||||
void ui_goodbye_title(void);
|
||||
void ui_beep(void);
|
||||
void ui_flash(void);
|
||||
void ui_handle_room_configuration_form_error(const char* const roomjid, const char* const message);
|
||||
void ui_handle_room_config_submit_result(const char* const roomjid);
|
||||
void ui_handle_room_config_submit_result_error(const char* const roomjid, const char* const message);
|
||||
|
||||
@@ -1475,3 +1475,13 @@ ui_is_suspended(void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
ui_beep(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ui_flash(void)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user