add /IGNORE ... NOHILIGHT to ignore some hilights

This commit is contained in:
Ailin Nemui 2021-01-16 00:31:56 +01:00
commit 46493c051b
6 changed files with 39 additions and 16 deletions

View file

@ -169,6 +169,8 @@ static void cmd_ignore(const char *data)
flags |= IGNORE_FIND_NOACT;
if (level & MSGLEVEL_HIDDEN)
flags |= IGNORE_FIND_HIDDEN;
if (level & MSGLEVEL_NOHILIGHT)
flags |= IGNORE_FIND_NOHILIGHT;
rec = ignore_find_full(servertag, mask, patternarg, channels, flags);
new_ignore = rec == NULL;
@ -198,6 +200,12 @@ static void cmd_ignore(const char *data)
rec->level |= MSGLEVEL_ALL;
}
if (rec->level == MSGLEVEL_NOHILIGHT) {
/* If only NOHILIGHT was specified add all levels; it makes no
* sense on its own. */
rec->level |= MSGLEVEL_ALL;
}
if (new_ignore && rec->level == 0) {
/* tried to unignore levels from nonexisting ignore */
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,

View file

@ -202,6 +202,11 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
level |= MSGLEVEL_HILIGHT;
ignore_check_plus(server, nick, address, target, msg, &level, FALSE);
if (level & MSGLEVEL_NOHILIGHT) {
for_me = FALSE;
g_free_and_null(color);
level &= ~MSGLEVEL_HILIGHT;
}
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis((WI_ITEM_REC *) chanrec, msg);

View file

@ -114,6 +114,12 @@ static void sig_message_irc_op_public(SERVER_REC *server, const char *msg,
return;
}
if (level & MSGLEVEL_NOHILIGHT) {
for_me = FALSE;
g_free_and_null(color);
level &= ~MSGLEVEL_HILIGHT;
}
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis((WI_ITEM_REC *) chanrec, msg);