Add searching & filtering for bits (#4069)

This commit is contained in:
Felanbird 2022-10-18 14:26:12 -04:00 committed by GitHub
parent 62b689e746
commit dd6cb80ab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 0 deletions

View file

@ -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)

View file

@ -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)},

View file

@ -25,6 +25,7 @@ static const QMap<QString, QString> 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?"},

View file

@ -44,6 +44,7 @@ enum class MessageFlag : int64_t {
ReplyMessage = (1LL << 24),
ElevatedMessage = (1LL << 25),
ParticipatedThread = (1LL << 26),
CheerMessage = (1LL << 27),
};
using MessageFlags = FlagsEnum<MessageFlag>;

View file

@ -38,6 +38,10 @@ MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags)
{
this->flags_.set(MessageFlag::ElevatedMessage);
}
else if (flag == "cheer-msg")
{
this->flags_.set(MessageFlag::CheerMessage);
}
}
}

View file

@ -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_)
{