This commit is contained in:
Moritz Wilhelmy 2017-04-16 01:17:20 +00:00 committed by GitHub
commit b5d65315ef
3 changed files with 13 additions and 6 deletions

View file

@ -31,6 +31,7 @@
#include "themes.h"
#include "fe-windows.h"
#include "printtext.h"
#include "window-activity.h"
static int beep_msg_level, beep_when_away, beep_when_window_active;
@ -427,7 +428,8 @@ void printtext_gui_internal(const char *str)
static void msg_beep_check(TEXT_DEST_REC *dest)
{
if (dest->level != 0 && (dest->level & MSGLEVEL_NO_ACT) == 0 &&
if (dest->level != 0 && !window_activity_target_is_hidden(dest) &&
(dest->level & MSGLEVEL_NO_ACT) == 0 &&
(beep_msg_level & dest->level) &&
(beep_when_away || (dest->server != NULL &&
!dest->server->usermode_away)) &&

View file

@ -70,6 +70,13 @@ void window_item_activity(WI_ITEM_REC *item, int data_level,
GINT_TO_POINTER(old_data_level));
}
int window_activity_target_is_hidden(TEXT_DEST_REC *dest)
{
/* check for both target and tag/target */
return hide_targets != NULL && (dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL &&
strarray_find_dest(hide_targets, dest);
}
static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg)
{
WI_ITEM_REC *item;
@ -85,11 +92,8 @@ static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg)
DATA_LEVEL_MSG : DATA_LEVEL_TEXT;
}
if (hide_targets != NULL && (dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL) {
/* check for both target and tag/target */
if (strarray_find_dest(hide_targets, dest))
return;
}
if (window_activity_target_is_hidden(dest))
return;
if (dest->target != NULL) {
item = window_item_find(dest->server, dest->target);

View file

@ -9,5 +9,6 @@ void window_item_activity(WI_ITEM_REC *item, int data_level,
void window_activity_init(void);
void window_activity_deinit(void);
int window_activity_target_is_hidden(TEXT_DEST_REC *dest);
#endif