mirror of
https://github.com/irssi/irssi.git
synced 2026-08-24 02:52:20 +02:00
Make activity_hide_targets setting inhibit beeps
This commit is contained in:
parent
113f1724d7
commit
44757f33e9
3 changed files with 11 additions and 1 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
#include "themes.h"
|
#include "themes.h"
|
||||||
#include "fe-windows.h"
|
#include "fe-windows.h"
|
||||||
#include "printtext.h"
|
#include "printtext.h"
|
||||||
|
#include "window-activity.h"
|
||||||
|
|
||||||
static int beep_msg_level, beep_when_away, beep_when_window_active;
|
static int beep_msg_level, beep_when_away, beep_when_window_active;
|
||||||
|
|
||||||
|
|
@ -407,7 +408,8 @@ void printtext_gui(const char *text)
|
||||||
|
|
||||||
static void msg_beep_check(TEXT_DEST_REC *dest)
|
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_msg_level & dest->level) &&
|
||||||
(beep_when_away || (dest->server != NULL &&
|
(beep_when_away || (dest->server != NULL &&
|
||||||
!dest->server->usermode_away)) &&
|
!dest->server->usermode_away)) &&
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,13 @@ void window_item_activity(WI_ITEM_REC *item, int data_level,
|
||||||
GINT_TO_POINTER(old_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)
|
static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg)
|
||||||
{
|
{
|
||||||
WI_ITEM_REC *item;
|
WI_ITEM_REC *item;
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,6 @@ void window_item_activity(WI_ITEM_REC *item, int data_level,
|
||||||
|
|
||||||
void window_activity_init(void);
|
void window_activity_init(void);
|
||||||
void window_activity_deinit(void);
|
void window_activity_deinit(void);
|
||||||
|
int window_activity_target_is_hidden(TEXT_DEST_REC *dest);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue