diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b17741ec..b1c47f1b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Minor: Clicking `A message from x was deleted` messages will now jump to the message in question. (#3953) - Minor: Added `is:first-msg` search option. (#3700) - Minor: Added `is:elevated-msg` search option. (#4018) +- Minor: Added `is:cheer-msg` search option. (#4069) - Minor: Added `subtier:` search option (e.g. `subtier:3` to find Tier 3 subs). (#4013) - Minor: Added `badge:` search option (e.g. `badge:mod` to users with the moderator badge). (#4013) - Minor: Added AutoMod message flag filter. (#3938) @@ -129,6 +130,7 @@ - Minor: Strip leading @ and trailing , from username in `/popout` command. (#3217) - Minor: Added `flags.reward_message` filter variable (#3231) - Minor: Added `flags.elevated_message` filter variable. (#4017) +- Minor: Added `flags.cheer_message` filter variable. (#4069) - Minor: Added chatter count to viewer list popout (#3261) - Minor: Ignore out of bounds check for tiling wms (#3270) - Minor: Add clear cache button to cache settings section (#3277) diff --git a/src/controllers/filters/parser/FilterParser.cpp b/src/controllers/filters/parser/FilterParser.cpp index e198aaeb9..9e71a365b 100644 --- a/src/controllers/filters/parser/FilterParser.cpp +++ b/src/controllers/filters/parser/FilterParser.cpp @@ -30,6 +30,7 @@ ContextMap buildContextMap(const MessagePtr &m, chatterino::Channel *channel) * flags.reward_message * flags.first_message * flags.elevated_message + * flags.cheer_message * flags.whisper * flags.reply * flags.automod @@ -85,6 +86,7 @@ ContextMap buildContextMap(const MessagePtr &m, chatterino::Channel *channel) m->flags.has(MessageFlag::RedeemedChannelPointReward)}, {"flags.first_message", m->flags.has(MessageFlag::FirstMessage)}, {"flags.elevated_message", m->flags.has(MessageFlag::ElevatedMessage)}, + {"flags.cheer_message", m->flags.has(MessageFlag::CheerMessage)}, {"flags.whisper", m->flags.has(MessageFlag::Whisper)}, {"flags.reply", m->flags.has(MessageFlag::ReplyMessage)}, {"flags.automod", m->flags.has(MessageFlag::AutoMod)}, diff --git a/src/controllers/filters/parser/Tokenizer.hpp b/src/controllers/filters/parser/Tokenizer.hpp index d0297545f..59f4b9cef 100644 --- a/src/controllers/filters/parser/Tokenizer.hpp +++ b/src/controllers/filters/parser/Tokenizer.hpp @@ -25,6 +25,7 @@ static const QMap validIdentifiersMap = { {"flags.reward_message", "channel point reward message?"}, {"flags.first_message", "first message?"}, {"flags.elevated_message", "elevated message?"}, + {"flags.cheer_message", "cheer message?"}, {"flags.whisper", "whisper message?"}, {"flags.reply", "reply message?"}, {"flags.automod", "automod message?"}, diff --git a/src/messages/Message.hpp b/src/messages/Message.hpp index 0468627a9..8e64c663a 100644 --- a/src/messages/Message.hpp +++ b/src/messages/Message.hpp @@ -44,6 +44,7 @@ enum class MessageFlag : int64_t { ReplyMessage = (1LL << 24), ElevatedMessage = (1LL << 25), ParticipatedThread = (1LL << 26), + CheerMessage = (1LL << 27), }; using MessageFlags = FlagsEnum; diff --git a/src/messages/search/MessageFlagsPredicate.cpp b/src/messages/search/MessageFlagsPredicate.cpp index 9f0d29d1b..3221da236 100644 --- a/src/messages/search/MessageFlagsPredicate.cpp +++ b/src/messages/search/MessageFlagsPredicate.cpp @@ -38,6 +38,10 @@ MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags) { this->flags_.set(MessageFlag::ElevatedMessage); } + else if (flag == "cheer-msg") + { + this->flags_.set(MessageFlag::CheerMessage); + } } } diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 7b39698ab..f284ba989 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -204,6 +204,11 @@ MessagePtr TwitchMessageBuilder::build() this->message().flags.set(MessageFlag::ElevatedMessage); } + if (this->tags.contains("bits")) + { + this->message().flags.set(MessageFlag::CheerMessage); + } + // reply threads if (this->thread_) {