about summary refs log tree commit diff
path: root/ignore.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-07 13:18:42 -0400
committerJune McEnroe <june@causal.agency>2020-04-07 13:18:42 -0400
commit73bda18110cfb52eecf7ad1089cd99d68f73e568 (patch)
tree6286531be4380ee6a92541bb262d2fecee896326 /ignore.c
parentReset unreadSoft only on first unreadHard (diff)
downloadcatgirl-73bda18110cfb52eecf7ad1089cd99d68f73e568.tar.gz
catgirl-73bda18110cfb52eecf7ad1089cd99d68f73e568.zip
Check ignores against id
Otherwise they do not work correctly for QUIT and NICK. This also lets
you ignore private messages only by putting the nick in the third field.
Diffstat (limited to 'ignore.c')
-rw-r--r--ignore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ignore.c b/ignore.c
index d65c35a..8aa3e1b 100644
--- a/ignore.c
+++ b/ignore.c
@@ -58,11 +58,11 @@ bool ignoreRemove(const char *pattern) {
 	return found;
 }
 
-enum Heat ignoreCheck(enum Heat heat, const struct Message *msg) {
+enum Heat ignoreCheck(enum Heat heat, uint id, const struct Message *msg) {
 	char match[512];
 	snprintf(
 		match, sizeof(match), "%s!%s@%s %s %s",
-		msg->nick, msg->user, msg->host, msg->cmd, (msg->params[0] ?: "")
+		msg->nick, msg->user, msg->host, msg->cmd, idNames[id]
 	);
 	for (size_t i = 0; i < ignore.len; ++i) {
 		if (fnmatch(ignore.patterns[i], match, FNM_CASEFOLD)) continue;