1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Ignore didn't check properly nick masks that contained only nick

without mask part (!*).


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1167 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-28 16:43:13 +00:00 committed by cras
parent 4bcae4c071
commit c4753213fe

View File

@ -101,8 +101,11 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
#define ignore_match_level(rec, level) \
((level & (rec)->level) != 0)
#define ignore_match_nickmask(rec, nickmask) \
((rec)->mask == NULL || match_wildcards((rec)->mask, nickmask))
#define ignore_match_nickmask(rec, nick, nickmask) \
((rec)->mask == NULL || \
(strchr((rec)->mask, '!') != NULL ? \
match_wildcards((rec)->mask, nickmask) : \
match_wildcards((rec)->mask, nick)))
#define ignore_match_server(rec, server) \
((rec)->servertag == NULL || \
@ -178,7 +181,7 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
if (ignore_match_level(rec, level) &&
ignore_match_server(rec, server) &&
ignore_match_channel(rec, channel) &&
ignore_match_nickmask(rec, nickmask) &&
ignore_match_nickmask(rec, nick, nickmask) &&
ignore_match_pattern(rec, text)) {
len = rec->mask == NULL ? 0 : strlen(rec->mask);
if (len > best_mask) {
@ -425,7 +428,7 @@ static void ignore_nick_cache(GHashTable *list, CHANNEL_REC *channel,
for (tmp = ignores; tmp != NULL; tmp = tmp->next) {
IGNORE_REC *rec = tmp->data;
if (ignore_match_nickmask(rec, nickmask) &&
if (ignore_match_nickmask(rec, nick->nick, nickmask) &&
ignore_match_server(rec, channel->server) &&
ignore_match_channel(rec, channel->name))
matches = g_slist_append(matches, rec);