mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
simplify ignore hidden/no_act code
This commit is contained in:
parent
b9a274a81d
commit
7e9f8c694b
6 changed files with 45 additions and 110 deletions
|
|
@ -201,11 +201,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
|
|||
if (for_me)
|
||||
level |= MSGLEVEL_HILIGHT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, target, msg, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, target, msg, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
ignore_check_plus(server, nick, address, target, msg, &level, FALSE);
|
||||
|
||||
if (settings_get_bool("emphasis"))
|
||||
msg = freemsg = expand_emphasis((WI_ITEM_REC *) chanrec, msg);
|
||||
|
|
@ -263,11 +259,7 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
|
|||
if (settings_get_bool("emphasis"))
|
||||
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
|
||||
|
||||
if (ignore_check_flags(server, nick, address, NULL, msg, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, NULL, msg, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
ignore_check_plus(server, nick, address, NULL, msg, &level, FALSE);
|
||||
|
||||
if (own) {
|
||||
printformat(server, target, level,
|
||||
|
|
@ -361,11 +353,7 @@ static void sig_message_join(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_JOINS;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, channel, NULL, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, channel, NULL, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
ignore_check_plus(server, nick, address, channel, NULL, &level, FALSE);
|
||||
|
||||
printformat(server, channel, level,
|
||||
TXT_JOIN, nick, address, channel);
|
||||
|
|
@ -377,11 +365,7 @@ static void sig_message_part(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_PARTS;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, channel, NULL, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, channel, NULL, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
ignore_check_plus(server, nick, address, channel, NULL, &level, FALSE);
|
||||
|
||||
printformat(server, channel, level,
|
||||
TXT_PART, nick, address, channel, reason);
|
||||
|
|
@ -396,15 +380,9 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
|
|||
char *print_channel;
|
||||
int once, count, level = MSGLEVEL_QUITS;
|
||||
|
||||
if (ignore_check(server, nick, address, NULL, reason, MSGLEVEL_QUITS))
|
||||
if (ignore_check_plus(server, nick, address, NULL, reason, &level, TRUE))
|
||||
return;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, NULL, reason, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, NULL, reason, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
|
||||
print_channel = NULL;
|
||||
once = settings_get_bool("show_quit_once");
|
||||
|
||||
|
|
@ -418,18 +396,12 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
|
|||
if (!nicklist_find(rec, nick))
|
||||
continue;
|
||||
|
||||
if (ignore_check(server, nick, address, rec->visible_name,
|
||||
reason, MSGLEVEL_QUITS)) {
|
||||
if (ignore_check_plus(server, nick, address, rec->visible_name,
|
||||
reason, &level, TRUE)) {
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ignore_check_flags(server, nick, address, rec->visible_name, reason, MSGLEVEL_QUITS, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, rec->visible_name, reason, MSGLEVEL_QUITS, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
|
||||
if (print_channel == NULL ||
|
||||
active_win->active == (WI_ITEM_REC *) rec)
|
||||
print_channel = rec->visible_name;
|
||||
|
|
@ -476,11 +448,7 @@ static void sig_message_kick(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_KICKS;
|
||||
|
||||
if (ignore_check_flags(server, kicker, address, channel, reason, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, kicker, address, channel, reason, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
ignore_check_plus(server, kicker, address, channel, reason, &level, FALSE);
|
||||
|
||||
printformat(server, channel, level,
|
||||
TXT_KICK, nick, channel, kicker, reason, address);
|
||||
|
|
@ -493,18 +461,11 @@ static void print_nick_change_channel(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level;
|
||||
|
||||
if (ignore_check(server, oldnick, address,
|
||||
channel, newnick, MSGLEVEL_NICKS))
|
||||
return;
|
||||
|
||||
level = MSGLEVEL_NICKS;
|
||||
if (ownnick) level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, oldnick, address, channel, newnick, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, oldnick, address, channel, newnick, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
if (ignore_check_plus(server, oldnick, address,
|
||||
channel, newnick, &level, TRUE))
|
||||
return;
|
||||
|
||||
printformat(server, channel, level,
|
||||
ownnick ? TXT_YOUR_NICK_CHANGED : TXT_NICK_CHANGED,
|
||||
|
|
@ -582,11 +543,7 @@ static void sig_message_topic(SERVER_REC *server, const char *channel,
|
|||
{
|
||||
int level = MSGLEVEL_TOPICS;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, channel, topic, level, MSGLEVEL_NO_ACT))
|
||||
level |= MSGLEVEL_NO_ACT;
|
||||
|
||||
if (ignore_check_flags(server, nick, address, channel, topic, level, MSGLEVEL_HIDDEN))
|
||||
level |= MSGLEVEL_HIDDEN;
|
||||
ignore_check_plus(server, nick, address, channel, topic, &level, FALSE);
|
||||
|
||||
printformat(server, channel, level,
|
||||
*topic != '\0' ? TXT_NEW_TOPIC : TXT_TOPIC_UNSET,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue