summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-01 20:09:10 -0500
committerJune McEnroe <june@causal.agency>2021-01-01 20:09:10 -0500
commit4b883177dc025db24473e62469f97631a12ad536 (patch)
tree0039251bc3093c68c44eb95fb7a1051168fe3acf /chat.h
parentFactor out reply count checking and decrementing (diff)
downloadcatgirl-4b883177dc025db24473e62469f97631a12ad536.tar.gz
catgirl-4b883177dc025db24473e62469f97631a12ad536.zip
Split ignore fields to avoid over-eager * matching
Split ignore fields and match each separately to avoid an early *
eagerly matching across several fields. For example, "* JOIN * *" should
not match messages which happen to contain the word "JOIN" followed by
two other words.

Ignore capacity is reduced to 64 to keep the size of the array the same.
I don't think it's an issue.
Diffstat (limited to '')
-rw-r--r--chat.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/chat.h b/chat.h
index c7af680..b06d383 100644
--- a/chat.h
+++ b/chat.h
@@ -353,13 +353,16 @@ void urlOpenCount(uint id, uint count);
 void urlOpenMatch(uint id, const char *str);
 void urlCopyMatch(uint id, const char *str);
 
-enum { IgnoreCap = 256 };
+enum { IgnoreCap = 64 };
 extern struct Ignore {
-	size_t len;
-	char *patterns[IgnoreCap];
-} ignore;
-const char *ignoreAdd(const char *pattern);
-bool ignoreRemove(const char *pattern);
+	char *mask;
+	char *cmd;
+	char *chan;
+	char *mesg;
+} ignores[IgnoreCap];
+struct Ignore ignoreParse(char *pattern);
+struct Ignore ignoreAdd(const char *pattern);
+bool ignoreRemove(struct Ignore ignore);
 enum Heat ignoreCheck(enum Heat heat, uint id, const struct Message *msg);
 
 extern bool logEnable;
8d22d9f34b8c5&follow=1'>Accommodate lower-case .jpg filesJune McEnroe 2024-06-23Add another BACKXWASH showJune McEnroe It was good! 2024-06-16Update bioJune McEnroe 2024-06-15Add photo descriptions from June 12June McEnroe 2024-06-10Add first roll of film from June 8June McEnroe 2024-06-10Cope with not having an EXIF infoJune McEnroe 2024-06-10Resize using target pixel counts for consistencyJune McEnroe This will resize film scans to about the same size as for the digital photos. 2024-06-10Add The Girl Who Was Convinced...June McEnroe Not much there. The illustrations are very nice though. 2024-06-09Add photos from May 31June McEnroe 2024-06-09Use monospace on photo pagesJune McEnroe 2024-06-09Put lens and (future) film at the tops of photo pagesJune McEnroe 2024-05-22Remove use of sysexits.hJune McEnroe 2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe 2024-05-21Fix = precedence in whenJune McEnroe