diff -r -U4 irssi-0.8.10/src/core/ignore.c irssi-0.8.10+byte/src/core/ignore.c --- irssi-0.8.10/src/core/ignore.c 2005-10-19 03:13:22.000000000 +0100 +++ irssi-0.8.10+byte/src/core/ignore.c 2006-02-15 19:54:48.000000000 +0000 @@ -39,9 +39,9 @@ static int time_tag; /* check if `text' contains ignored nick at the start of the line. */ static int ignore_check_replies_rec(IGNORE_REC *rec, CHANNEL_REC *channel, - const char *text) + const char *text, int level) { GSList *nicks, *tmp; nicks = nicklist_find_multiple(channel, rec->mask); @@ -49,17 +49,21 @@ for (tmp = nicks; tmp != NULL; tmp = tmp->next) { NICK_REC *nick = tmp->data; - if (nick_match_msg(channel, text, nick->nick)) - return TRUE; + if (nick_match_msg(channel, text, nick->nick)) { + if ((level & MSGLEVEL_HILIGHT) == 0) return TRUE; + // for hilights, check that the text is clearly a reply + // i.e. "nick:..." not "nick..." or "moo,nick..." + if (strlen(text) > strlen(nick->nick) && text[strlen(nick->nick)] == ':') return TRUE; + } } g_slist_free(nicks); return FALSE; } -static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text) +static int ignore_check_replies(CHANNEL_REC *chanrec, const char *text, int level) { GSList *tmp; if (text == NULL || chanrec == NULL) @@ -68,10 +72,10 @@ /* check reply ignores */ for (tmp = ignores; tmp != NULL; tmp = tmp->next) { IGNORE_REC *rec = tmp->data; - if (rec->mask != NULL && rec->replies && - ignore_check_replies_rec(rec, chanrec, text)) + if (rec->mask != NULL && rec->replies && (level & rec->level) != 0 && + ignore_check_replies_rec(rec, chanrec, text, level)) return TRUE; } return FALSE; @@ -126,8 +130,9 @@ for (tmp = list; tmp != NULL; tmp = tmp->next) { IGNORE_REC *rec = tmp->data; if (ignore_match_level(rec, level) && + (!rec->replies || (level & MSGLEVEL_HILIGHT) == 0) && ignore_match_pattern(rec, text)) { len = rec->mask == NULL ? 0 : strlen(rec->mask); if (len > best_mask) { best_mask = len; @@ -141,12 +146,12 @@ } } } - if (best_match || (level & MSGLEVEL_PUBLIC) == 0) + if (best_match || (level & (MSGLEVEL_PUBLIC|MSGLEVEL_HILIGHT)) == 0) return best_match; - return ignore_check_replies(channel, text); + return ignore_check_replies(channel, text, level); } int ignore_check(SERVER_REC *server, const char *nick, const char *host, const char *channel, const char *text, int level) @@ -182,9 +187,10 @@ if (ignore_match_level(rec, level) && ignore_match_server(rec, server) && ignore_match_channel(rec, channel) && ignore_match_nickmask(rec, nick, nickmask) && - ignore_match_pattern(rec, text)) { + ignore_match_pattern(rec, text) && + (!rec->replies || (level & MSGLEVEL_HILIGHT) == 0)) { len = rec->mask == NULL ? 0 : strlen(rec->mask); if (len > best_mask) { best_mask = len; best_match = !rec->exception; @@ -198,12 +204,12 @@ } } g_free(nickmask); - if (best_match || (level & MSGLEVEL_PUBLIC) == 0) + if (best_match || (level & (MSGLEVEL_PUBLIC|MSGLEVEL_HILIGHT)) == 0) return best_match; - return ignore_check_replies(chanrec, text); + return ignore_check_replies(chanrec, text, level); } IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels) diff -r -U4 irssi-0.8.10/src/fe-common/core/hilight-text.c irssi-0.8.10+byte/src/fe-common/core/hilight-text.c --- irssi-0.8.10/src/fe-common/core/hilight-text.c 2005-10-19 03:13:20.000000000 +0100 +++ irssi-0.8.10+byte/src/fe-common/core/hilight-text.c 2006-02-15 18:49:21.000000000 +0000 @@ -34,8 +34,9 @@ #include "hilight-text.h" #include "nickmatch-cache.h" #include "printtext.h" #include "formats.h" +#include "ignore.h" static NICKMATCH_REC *nickmatch; static int never_hilight_level, default_hilight_level; GSList *hilights; @@ -252,20 +253,25 @@ if (nickrec->host == NULL) nicklist_set_host(chanrec, nickrec, address); rec = nickmatch_find(nickmatch, nickrec); - if (rec != NULL && hilight_match_level(rec, level)) + if (rec != NULL && hilight_match_level(rec, level)) { + if (ignore_check(server, nick, address, channel, str, MSGLEVEL_HILIGHT)) return NULL; return rec; + } } } for (tmp = hilights; tmp != NULL; tmp = tmp->next) { HILIGHT_REC *rec = tmp->data; if (!rec->nickmask && hilight_match_level(rec, level) && hilight_match_channel(rec, channel) && - hilight_match_text(rec, str, match_beg, match_end)) + hilight_match_text(rec, str, match_beg, match_end)) { + + if (ignore_check(server, nick, address, channel, str, MSGLEVEL_HILIGHT)) return NULL; return rec; + } } return NULL; }