From 25f419465f019feedb7266cb68232d1b32a66957 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Tue, 31 Mar 2020 14:30:42 -0400 Subject: Add /ignore message filtering patterns --- chat.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'chat.h') diff --git a/chat.h b/chat.h index 545be03..7bcac3b 100644 --- a/chat.h +++ b/chat.h @@ -200,7 +200,7 @@ const char *commandIsNotice(uint id, const char *input); const char *commandIsAction(uint id, const char *input); void commandCompleteAdd(void); -enum Heat { Cold, Warm, Hot }; +enum Heat { Ice, Cold, Warm, Hot }; extern struct Util uiNotifyUtil; void uiInit(void); void uiShow(void); @@ -261,6 +261,15 @@ void urlOpenCount(uint id, uint count); void urlOpenMatch(uint id, const char *str); void urlCopyMatch(uint id, const char *str); +enum { IgnoreCap = 256 }; +extern struct Ignore { + size_t len; + char *patterns[IgnoreCap]; +} ignore; +const char *ignoreAdd(const char *pattern); +bool ignoreRemove(const char *pattern); +enum Heat ignoreCheck(enum Heat heat, const struct Message *msg); + extern bool logEnable; void logFormat(uint id, const time_t *time, const char *format, ...) __attribute__((format(printf, 3, 4))); -- cgit 1.4.1-2-gfad0