diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-28 16:43:13 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-28 16:43:13 +0000 |
commit | c4753213feb5285ff2c494ebf62f82cde0b0f06e (patch) | |
tree | 77fa29fb276228162ec1130322918d6da429a0cd | |
parent | 4bcae4c071c149c2fd3c03756a1ffa1a782a8c1b (diff) | |
download | irssi-c4753213feb5285ff2c494ebf62f82cde0b0f06e.zip |
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
-rw-r--r-- | src/core/ignore.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/ignore.c b/src/core/ignore.c index 45fbaa52..e09b591f 100644 --- a/src/core/ignore.c +++ b/src/core/ignore.c @@ -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); |