mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Change NO_ACT so it can be used in addition to other ignores
This results in a more flexible system and is less surprising as it means levels can be used in the way they normally can in an ignore. As an example the current approach to NO_ACT provides no way to let HILIGHTS be shown, with this change /set activity_hide_targets can be recreated with: /ignore #channel NO_ACT /ignore #channel -except -regexp -pattern . NO_ACT HILIGHTS (but obviously this can be configured in many more ways if desired).
This commit is contained in:
parent
2b6bba3fd2
commit
819f9d16c9
5 changed files with 62 additions and 13 deletions
|
|
@ -190,7 +190,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
|
|||
if (for_me)
|
||||
level |= MSGLEVEL_HILIGHT;
|
||||
|
||||
if (ignore_check(server, nick, address, target, msg, MSGLEVEL_NO_ACT))
|
||||
if (ignore_check(server, nick, address, target, msg, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (settings_get_bool("emphasis"))
|
||||
|
|
@ -238,13 +238,17 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
|
|||
{
|
||||
QUERY_REC *query;
|
||||
char *freemsg = NULL;
|
||||
int level = MSGLEVEL_MSGS;
|
||||
|
||||
query = query_find(server, nick);
|
||||
|
||||
if (settings_get_bool("emphasis"))
|
||||
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
|
||||
|
||||
printformat(server, nick, MSGLEVEL_MSGS,
|
||||
if (ignore_check(server, nick, address, NULL, msg, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
printformat(server, nick, level,
|
||||
query == NULL ? TXT_MSG_PRIVATE :
|
||||
TXT_MSG_PRIVATE_QUERY, nick, address, msg);
|
||||
|
||||
|
|
@ -330,7 +334,7 @@ static void sig_message_join(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_JOINS;
|
||||
|
||||
if (ignore_check(server, nick, address, channel, NULL, MSGLEVEL_NO_ACT))
|
||||
if (ignore_check(server, nick, address, channel, NULL, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
printformat(server, channel, level,
|
||||
|
|
@ -343,7 +347,7 @@ static void sig_message_part(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_PARTS;
|
||||
|
||||
if (ignore_check(server, nick, address, channel, NULL, MSGLEVEL_NO_ACT))
|
||||
if (ignore_check(server, nick, address, channel, NULL, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
printformat(server, channel, level,
|
||||
|
|
@ -362,7 +366,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
|
|||
if (ignore_check(server, nick, address, NULL, reason, MSGLEVEL_QUITS))
|
||||
return;
|
||||
|
||||
if (ignore_check(server, nick, address, NULL, reason, MSGLEVEL_NO_ACT))
|
||||
if (ignore_check(server, nick, address, NULL, reason, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
print_channel = NULL;
|
||||
|
|
@ -432,7 +436,7 @@ static void sig_message_kick(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_KICKS;
|
||||
|
||||
if (ignore_check(server, kicker, address, channel, reason, MSGLEVEL_NO_ACT))
|
||||
if (ignore_check(server, kicker, address, channel, reason, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
printformat(server, channel, level,
|
||||
|
|
@ -453,7 +457,7 @@ static void print_nick_change_channel(SERVER_REC *server, const char *channel,
|
|||
level = MSGLEVEL_NICKS;
|
||||
if (ownnick) level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (!(level & MSGLEVEL_NO_ACT) && ignore_check(server, oldnick, address, channel, newnick, MSGLEVEL_NO_ACT))
|
||||
if (!(level & MSGLEVEL_NO_ACT) && ignore_check(server, oldnick, address, channel, newnick, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
printformat(server, channel, level,
|
||||
|
|
@ -532,7 +536,7 @@ static void sig_message_topic(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_TOPICS;
|
||||
|
||||
if (ignore_check(server, nick, address, channel, topic, MSGLEVEL_NO_ACT))
|
||||
if (ignore_check(server, nick, address, channel, topic, level | MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
printformat(server, channel, level,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue