From dcd42cb28bde2efc17d9afa0e36d6f5f1d3971de Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 28 Aug 2022 13:31:53 +0200 Subject: [PATCH] Add AutoMod message flag filter (#3938) --- CHANGELOG.md | 1 + src/controllers/filters/parser/FilterParser.cpp | 3 +++ src/controllers/filters/parser/Tokenizer.hpp | 1 + 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ed9a7339..5aab1fd16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Minor: Warn when parsing an environment variable fails. (#3904) - Minor: Load missing messages from Recent Messages API upon reconnecting (#3878, #3932) - Minor: Add settings to toggle BTTV/FFZ global/channel emotes (#3935) +- Minor: Add AutoMod message flag filter. (#3938) - Bugfix: Fix crash that can occur when closing and quickly reopening a split, then running a command. (#3852) - Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716) - Bugfix: Fix crash that can occur when changing channels. (#3799) diff --git a/src/controllers/filters/parser/FilterParser.cpp b/src/controllers/filters/parser/FilterParser.cpp index f4c80efa6..104192641 100644 --- a/src/controllers/filters/parser/FilterParser.cpp +++ b/src/controllers/filters/parser/FilterParser.cpp @@ -30,6 +30,8 @@ ContextMap buildContextMap(const MessagePtr &m, chatterino::Channel *channel) * flags.reward_message * flags.first_message * flags.whisper + * flags.reply + * flags.automod * * message.content * message.length @@ -83,6 +85,7 @@ ContextMap buildContextMap(const MessagePtr &m, chatterino::Channel *channel) {"flags.first_message", m->flags.has(MessageFlag::FirstMessage)}, {"flags.whisper", m->flags.has(MessageFlag::Whisper)}, {"flags.reply", m->flags.has(MessageFlag::ReplyMessage)}, + {"flags.automod", m->flags.has(MessageFlag::AutoMod)}, {"message.content", m->messageText}, {"message.length", m->messageText.length()}, diff --git a/src/controllers/filters/parser/Tokenizer.hpp b/src/controllers/filters/parser/Tokenizer.hpp index 752616078..4e5a6798d 100644 --- a/src/controllers/filters/parser/Tokenizer.hpp +++ b/src/controllers/filters/parser/Tokenizer.hpp @@ -26,6 +26,7 @@ static const QMap validIdentifiersMap = { {"flags.first_message", "first message?"}, {"flags.whisper", "whisper message?"}, {"flags.reply", "reply message?"}, + {"flags.automod", "automod message?"}, {"message.content", "message text"}, {"message.length", "message length"}};