mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
Merge pull request #937 from ailin-nemui/hidden-ignores
correctly separate ignore flags (no_act, hidden) from level
This commit is contained in:
commit
57857856a6
7 changed files with 99 additions and 119 deletions
|
|
@ -82,16 +82,21 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
|
||||||
* However we also want to allow NO_ACT combined with levels, so mask it out and
|
* However we also want to allow NO_ACT combined with levels, so mask it out and
|
||||||
* match levels if set. */
|
* match levels if set. */
|
||||||
#define FLAG_MSGLEVELS ( MSGLEVEL_NO_ACT | MSGLEVEL_HIDDEN )
|
#define FLAG_MSGLEVELS ( MSGLEVEL_NO_ACT | MSGLEVEL_HIDDEN )
|
||||||
static int ignore_match_level(IGNORE_REC *rec, int level)
|
static int ignore_match_level(IGNORE_REC *rec, int level, int flags)
|
||||||
{
|
{
|
||||||
if (level & FLAG_MSGLEVELS) {
|
level &= ~FLAG_MSGLEVELS;
|
||||||
int flaglevel = level & FLAG_MSGLEVELS;
|
flags &= FLAG_MSGLEVELS;
|
||||||
int msglevel = level & ~FLAG_MSGLEVELS;
|
|
||||||
return (msglevel & rec->level) && (flaglevel & rec->level);
|
if (!flags) {
|
||||||
} else if (!(rec->level & FLAG_MSGLEVELS)) {
|
/* case: we are not checking special flags. then, the
|
||||||
return (level & rec->level);
|
record must not have any flags either, but it must
|
||||||
|
have some of the levels */
|
||||||
|
return !(FLAG_MSGLEVELS & rec->level) && (level & rec->level);
|
||||||
} else {
|
} else {
|
||||||
return FALSE;
|
/* case: we want to test if some special flags
|
||||||
|
apply. then, the record must have some of the
|
||||||
|
flags and some of the levels */
|
||||||
|
return (flags & rec->level) && (level & rec->level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,7 +114,7 @@ static int ignore_match_level(IGNORE_REC *rec, int level)
|
||||||
((rec)->channels == NULL || ((channel) != NULL && \
|
((rec)->channels == NULL || ((channel) != NULL && \
|
||||||
strarray_find((rec)->channels, (channel)) != -1))
|
strarray_find((rec)->channels, (channel)) != -1))
|
||||||
|
|
||||||
static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text, int level)
|
static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text, int level, int flags)
|
||||||
{
|
{
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
|
|
||||||
|
|
@ -121,7 +126,7 @@ static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text, int leve
|
||||||
IGNORE_REC *rec = tmp->data;
|
IGNORE_REC *rec = tmp->data;
|
||||||
|
|
||||||
if (rec->mask != NULL && rec->replies &&
|
if (rec->mask != NULL && rec->replies &&
|
||||||
ignore_match_level(rec, level) &&
|
ignore_match_level(rec, level, flags) &&
|
||||||
ignore_match_channel(rec, chanrec->name) &&
|
ignore_match_channel(rec, chanrec->name) &&
|
||||||
ignore_check_replies_rec(rec, chanrec, text))
|
ignore_check_replies_rec(rec, chanrec, text))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
@ -130,8 +135,8 @@ static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text, int leve
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
int ignore_check_flags(SERVER_REC *server, const char *nick, const char *host,
|
||||||
const char *channel, const char *text, int level)
|
const char *channel, const char *text, int level, int flags)
|
||||||
{
|
{
|
||||||
CHANNEL_REC *chanrec;
|
CHANNEL_REC *chanrec;
|
||||||
NICK_REC *nickrec;
|
NICK_REC *nickrec;
|
||||||
|
|
@ -167,7 +172,7 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
||||||
ignore_match_channel(rec, channel) &&
|
ignore_match_channel(rec, channel) &&
|
||||||
ignore_match_nickmask(rec, nick, nickmask);
|
ignore_match_nickmask(rec, nick, nickmask);
|
||||||
if (match &&
|
if (match &&
|
||||||
ignore_match_level(rec, level) &&
|
ignore_match_level(rec, level, flags) &&
|
||||||
ignore_match_pattern(rec, text)) {
|
ignore_match_pattern(rec, text)) {
|
||||||
len = rec->mask == NULL ? 0 : strlen(rec->mask);
|
len = rec->mask == NULL ? 0 : strlen(rec->mask);
|
||||||
if (len > best_mask) {
|
if (len > best_mask) {
|
||||||
|
|
@ -188,7 +193,28 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
||||||
if (best_match || (level & MSGLEVEL_PUBLIC) == 0)
|
if (best_match || (level & MSGLEVEL_PUBLIC) == 0)
|
||||||
return best_match;
|
return best_match;
|
||||||
|
|
||||||
return ignore_check_replies(chanrec, text, level);
|
return ignore_check_replies(chanrec, text, level, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
||||||
|
const char *channel, const char *text, int level) {
|
||||||
|
return ignore_check_flags(server, nick, host, channel, text, level, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ignore_check_plus(SERVER_REC *server, const char *nick, const char *address,
|
||||||
|
const char *target, const char *msg, int *level, int test_ignore) {
|
||||||
|
int olevel = *level;
|
||||||
|
|
||||||
|
if (test_ignore && ignore_check(server, nick, address, target, msg, olevel))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (ignore_check_flags(server, nick, address, target, msg, olevel, MSGLEVEL_NO_ACT))
|
||||||
|
*level |= MSGLEVEL_NO_ACT;
|
||||||
|
|
||||||
|
if (ignore_check_flags(server, nick, address, target, msg, olevel, MSGLEVEL_HIDDEN))
|
||||||
|
*level |= MSGLEVEL_HIDDEN;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
IGNORE_REC *ignore_find_full(const char *servertag, const char *mask, const char *pattern,
|
IGNORE_REC *ignore_find_full(const char *servertag, const char *mask, const char *pattern,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ extern GSList *ignores;
|
||||||
|
|
||||||
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
||||||
const char *channel, const char *text, int level);
|
const char *channel, const char *text, int level);
|
||||||
|
int ignore_check_flags(SERVER_REC *server, const char *nick, const char *host,
|
||||||
|
const char *channel, const char *text, int level, int flags);
|
||||||
|
int ignore_check_plus(SERVER_REC *server, const char *nick, const char *host,
|
||||||
|
const char *channel, const char *text, int *level, int test_ignore);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
IGNORE_FIND_PATTERN = 0x01, /* Match the pattern */
|
IGNORE_FIND_PATTERN = 0x01, /* Match the pattern */
|
||||||
|
|
|
||||||
|
|
@ -201,11 +201,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
|
||||||
if (for_me)
|
if (for_me)
|
||||||
level |= MSGLEVEL_HILIGHT;
|
level |= MSGLEVEL_HILIGHT;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, target, msg, level | MSGLEVEL_NO_ACT))
|
ignore_check_plus(server, nick, address, target, msg, &level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, target, msg, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
if (settings_get_bool("emphasis"))
|
if (settings_get_bool("emphasis"))
|
||||||
msg = freemsg = expand_emphasis((WI_ITEM_REC *) chanrec, msg);
|
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"))
|
if (settings_get_bool("emphasis"))
|
||||||
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
|
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, NULL, msg, level | MSGLEVEL_NO_ACT))
|
ignore_check_plus(server, nick, address, NULL, msg, &level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, NULL, msg, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
if (own) {
|
if (own) {
|
||||||
printformat(server, target, level,
|
printformat(server, target, level,
|
||||||
|
|
@ -361,11 +353,7 @@ static void sig_message_join(SERVER_REC *server, const char *channel,
|
||||||
{
|
{
|
||||||
int level = MSGLEVEL_JOINS;
|
int level = MSGLEVEL_JOINS;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, channel, NULL, level | MSGLEVEL_NO_ACT))
|
ignore_check_plus(server, nick, address, channel, NULL, &level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, channel, NULL, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
printformat(server, channel, level,
|
printformat(server, channel, level,
|
||||||
TXT_JOIN, nick, address, channel);
|
TXT_JOIN, nick, address, channel);
|
||||||
|
|
@ -377,11 +365,7 @@ static void sig_message_part(SERVER_REC *server, const char *channel,
|
||||||
{
|
{
|
||||||
int level = MSGLEVEL_PARTS;
|
int level = MSGLEVEL_PARTS;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, channel, NULL, level | MSGLEVEL_NO_ACT))
|
ignore_check_plus(server, nick, address, channel, NULL, &level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, channel, NULL, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
printformat(server, channel, level,
|
printformat(server, channel, level,
|
||||||
TXT_PART, nick, address, channel, reason);
|
TXT_PART, nick, address, channel, reason);
|
||||||
|
|
@ -396,15 +380,9 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
|
||||||
char *print_channel;
|
char *print_channel;
|
||||||
int once, count, level = MSGLEVEL_QUITS;
|
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;
|
return;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, NULL, reason, level | MSGLEVEL_NO_ACT))
|
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, NULL, reason, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
print_channel = NULL;
|
print_channel = NULL;
|
||||||
once = settings_get_bool("show_quit_once");
|
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))
|
if (!nicklist_find(rec, nick))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, rec->visible_name,
|
if (ignore_check_plus(server, nick, address, rec->visible_name,
|
||||||
reason, MSGLEVEL_QUITS)) {
|
reason, &level, TRUE)) {
|
||||||
count++;
|
count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, rec->visible_name, reason, MSGLEVEL_NO_ACT))
|
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, rec->visible_name, reason, MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
if (print_channel == NULL ||
|
if (print_channel == NULL ||
|
||||||
active_win->active == (WI_ITEM_REC *) rec)
|
active_win->active == (WI_ITEM_REC *) rec)
|
||||||
print_channel = rec->visible_name;
|
print_channel = rec->visible_name;
|
||||||
|
|
@ -476,11 +448,7 @@ static void sig_message_kick(SERVER_REC *server, const char *channel,
|
||||||
{
|
{
|
||||||
int level = MSGLEVEL_KICKS;
|
int level = MSGLEVEL_KICKS;
|
||||||
|
|
||||||
if (ignore_check(server, kicker, address, channel, reason, level | MSGLEVEL_NO_ACT))
|
ignore_check_plus(server, kicker, address, channel, reason, &level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, kicker, address, channel, reason, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
printformat(server, channel, level,
|
printformat(server, channel, level,
|
||||||
TXT_KICK, nick, channel, kicker, reason, address);
|
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;
|
int level;
|
||||||
|
|
||||||
if (ignore_check(server, oldnick, address,
|
|
||||||
channel, newnick, MSGLEVEL_NICKS))
|
|
||||||
return;
|
|
||||||
|
|
||||||
level = MSGLEVEL_NICKS;
|
level = MSGLEVEL_NICKS;
|
||||||
if (ownnick) level |= MSGLEVEL_NO_ACT;
|
if (ownnick) level |= MSGLEVEL_NO_ACT;
|
||||||
|
if (ignore_check_plus(server, oldnick, address,
|
||||||
if (!(level & MSGLEVEL_NO_ACT) && ignore_check(server, oldnick, address, channel, newnick, level | MSGLEVEL_NO_ACT))
|
channel, newnick, &level, TRUE))
|
||||||
level |= MSGLEVEL_NO_ACT;
|
return;
|
||||||
|
|
||||||
if (!(level & MSGLEVEL_HIDDEN) && ignore_check(server, oldnick, address, channel, newnick, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
printformat(server, channel, level,
|
printformat(server, channel, level,
|
||||||
ownnick ? TXT_YOUR_NICK_CHANGED : TXT_NICK_CHANGED,
|
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;
|
int level = MSGLEVEL_TOPICS;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, channel, topic, level | MSGLEVEL_NO_ACT))
|
ignore_check_plus(server, nick, address, channel, topic, &level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address, channel, topic, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
printformat(server, channel, level,
|
printformat(server, channel, level,
|
||||||
*topic != '\0' ? TXT_NEW_TOPIC : TXT_TOPIC_UNSET,
|
*topic != '\0' ? TXT_NEW_TOPIC : TXT_TOPIC_UNSET,
|
||||||
|
|
|
||||||
|
|
@ -92,13 +92,8 @@ static void sig_message_dcc(CHAT_DCC_REC *dcc, const char *msg)
|
||||||
tag = g_strconcat("=", dcc->id, NULL);
|
tag = g_strconcat("=", dcc->id, NULL);
|
||||||
query = query_find(NULL, tag);
|
query = query_find(NULL, tag);
|
||||||
|
|
||||||
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
|
ignore_check_plus(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
|
||||||
level | MSGLEVEL_NO_ACT))
|
&level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
|
|
||||||
level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
|
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
|
||||||
level, NULL);
|
level, NULL);
|
||||||
|
|
@ -118,13 +113,8 @@ static void sig_message_dcc_action(CHAT_DCC_REC *dcc, const char *msg)
|
||||||
tag = g_strconcat("=", dcc->id, NULL);
|
tag = g_strconcat("=", dcc->id, NULL);
|
||||||
query = query_find(NULL, tag);
|
query = query_find(NULL, tag);
|
||||||
|
|
||||||
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
|
ignore_check_plus(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
|
||||||
level | MSGLEVEL_NO_ACT))
|
&level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
|
|
||||||
level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
|
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
|
||||||
level, NULL);
|
level, NULL);
|
||||||
|
|
@ -143,13 +133,8 @@ static void sig_message_dcc_ctcp(CHAT_DCC_REC *dcc, const char *cmd,
|
||||||
|
|
||||||
tag = g_strconcat("=", dcc->id, NULL);
|
tag = g_strconcat("=", dcc->id, NULL);
|
||||||
|
|
||||||
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, cmd,
|
ignore_check_plus(SERVER(dcc->server), tag, dcc->addrstr, NULL, cmd,
|
||||||
level | MSGLEVEL_NO_ACT))
|
&level, FALSE);
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(SERVER(dcc->server), tag, dcc->addrstr, NULL, cmd,
|
|
||||||
level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
|
format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
|
||||||
level, NULL);
|
level, NULL);
|
||||||
|
|
|
||||||
|
|
@ -155,17 +155,9 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg,
|
||||||
level = MSGLEVEL_ACTIONS |
|
level = MSGLEVEL_ACTIONS |
|
||||||
(server_ischannel(SERVER(server), target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS);
|
(server_ischannel(SERVER(server), target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS);
|
||||||
|
|
||||||
if (ignore_check(SERVER(server), nick, address, target, msg, level))
|
if (ignore_check_plus(SERVER(server), nick, address, target, msg, &level, TRUE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ignore_check(SERVER(server), nick, address, target, msg,
|
|
||||||
level | MSGLEVEL_NO_ACT))
|
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(SERVER(server), nick, address, target, msg,
|
|
||||||
level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
if (server_ischannel(SERVER(server), target)) {
|
if (server_ischannel(SERVER(server), target)) {
|
||||||
item = irc_channel_find(server, target);
|
item = irc_channel_find(server, target);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -226,30 +218,21 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg,
|
||||||
target = fe_channel_skip_prefix(IRC_SERVER(server), target);
|
target = fe_channel_skip_prefix(IRC_SERVER(server), target);
|
||||||
|
|
||||||
if (address == NULL || *address == '\0') {
|
if (address == NULL || *address == '\0') {
|
||||||
|
level = MSGLEVEL_SNOTES;
|
||||||
/* notice from server */
|
/* notice from server */
|
||||||
if (!ignore_check(server, nick, "",
|
if (!ignore_check_plus(server, nick, "",
|
||||||
target, msg, MSGLEVEL_SNOTES)) {
|
target, msg, &level, TRUE)) {
|
||||||
printformat(server, target, MSGLEVEL_SNOTES,
|
printformat(server, target, level,
|
||||||
IRCTXT_NOTICE_SERVER, nick, msg);
|
IRCTXT_NOTICE_SERVER, nick, msg);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ignore_check(server, nick, address,
|
if (ignore_check_plus(server, nick, address,
|
||||||
server_ischannel(SERVER(server), target) ? target : NULL,
|
server_ischannel(SERVER(server), target) ? target : NULL,
|
||||||
msg, level))
|
msg, &level, TRUE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ignore_check(server, nick, address,
|
|
||||||
server_ischannel(SERVER(server), target) ? target : NULL,
|
|
||||||
msg, level | MSGLEVEL_NO_ACT))
|
|
||||||
level |= MSGLEVEL_NO_ACT;
|
|
||||||
|
|
||||||
if (ignore_check(server, nick, address,
|
|
||||||
server_ischannel(SERVER(server), target) ? target : NULL,
|
|
||||||
msg, level | MSGLEVEL_HIDDEN))
|
|
||||||
level |= MSGLEVEL_HIDDEN;
|
|
||||||
|
|
||||||
if (server_ischannel(SERVER(server), target)) {
|
if (server_ischannel(SERVER(server), target)) {
|
||||||
/* notice in some channel */
|
/* notice in some channel */
|
||||||
printformat(server, target, level,
|
printformat(server, target, level,
|
||||||
|
|
|
||||||
|
|
@ -162,19 +162,21 @@ static void sig_message_mode(IRC_SERVER_REC *server, const char *channel,
|
||||||
const char *nick, const char *addr,
|
const char *nick, const char *addr,
|
||||||
const char *mode)
|
const char *mode)
|
||||||
{
|
{
|
||||||
|
int level = MSGLEVEL_MODES;
|
||||||
|
|
||||||
if (nick == NULL) nick = server->real_address;
|
if (nick == NULL) nick = server->real_address;
|
||||||
|
|
||||||
if (ignore_check(SERVER(server), nick, addr, channel,
|
if (ignore_check_plus(SERVER(server), nick, addr, channel,
|
||||||
mode, MSGLEVEL_MODES))
|
mode, &level, TRUE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!server_ischannel(SERVER(server), channel)) {
|
if (!server_ischannel(SERVER(server), channel)) {
|
||||||
/* user mode change */
|
/* user mode change */
|
||||||
printformat(server, NULL, MSGLEVEL_MODES,
|
printformat(server, NULL, level,
|
||||||
IRCTXT_USERMODE_CHANGE, mode, channel);
|
IRCTXT_USERMODE_CHANGE, mode, channel);
|
||||||
} else if (addr == NULL) {
|
} else if (addr == NULL) {
|
||||||
/* channel mode changed by server */
|
/* channel mode changed by server */
|
||||||
printformat(server, channel, MSGLEVEL_MODES,
|
printformat(server, channel, level,
|
||||||
IRCTXT_SERVER_CHANMODE_CHANGE,
|
IRCTXT_SERVER_CHANMODE_CHANGE,
|
||||||
channel, mode, nick);
|
channel, mode, nick);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -187,7 +189,7 @@ static void sig_message_mode(IRC_SERVER_REC *server, const char *channel,
|
||||||
if (chanrec != NULL && g_ascii_strcasecmp(nick, server->nick) != 0)
|
if (chanrec != NULL && g_ascii_strcasecmp(nick, server->nick) != 0)
|
||||||
msg_multi_mode(chanrec, nick, addr, mode);
|
msg_multi_mode(chanrec, nick, addr, mode);
|
||||||
else {
|
else {
|
||||||
printformat(server, channel, MSGLEVEL_MODES,
|
printformat(server, channel, level,
|
||||||
IRCTXT_CHANMODE_CHANGE,
|
IRCTXT_CHANMODE_CHANGE,
|
||||||
channel, mode, nick, addr);
|
channel, mode, nick, addr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,19 @@ CODE:
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
|
||||||
|
int
|
||||||
|
ignore_check_flags(nick, host, channel, text, level, flags)
|
||||||
|
char *nick
|
||||||
|
char *host
|
||||||
|
char *channel
|
||||||
|
char *text
|
||||||
|
int level
|
||||||
|
int flags
|
||||||
|
CODE:
|
||||||
|
RETVAL = ignore_check_flags(NULL, nick, host, channel, text, level, flags);
|
||||||
|
OUTPUT:
|
||||||
|
RETVAL
|
||||||
|
|
||||||
#*******************************
|
#*******************************
|
||||||
MODULE = Irssi::Ignore PACKAGE = Irssi::Server
|
MODULE = Irssi::Ignore PACKAGE = Irssi::Server
|
||||||
#*******************************
|
#*******************************
|
||||||
|
|
@ -38,6 +51,16 @@ ignore_check(server, nick, host, channel, text, level)
|
||||||
char *text
|
char *text
|
||||||
int level
|
int level
|
||||||
|
|
||||||
|
int
|
||||||
|
ignore_check_flags(server, nick, host, channel, text, level, flags)
|
||||||
|
Irssi::Server server
|
||||||
|
char *nick
|
||||||
|
char *host
|
||||||
|
char *channel
|
||||||
|
char *text
|
||||||
|
int level
|
||||||
|
int flags
|
||||||
|
|
||||||
#*******************************
|
#*******************************
|
||||||
MODULE = Irssi::Ignore PACKAGE = Irssi::Ignore PREFIX = ignore_
|
MODULE = Irssi::Ignore PACKAGE = Irssi::Ignore PREFIX = ignore_
|
||||||
#*******************************
|
#*******************************
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue