diff --git a/CHANGELOG.md b/CHANGELOG.md index d9161a5d7..5ada5750b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,9 @@ - Minor: Added an icon showing when streamer mode is enabled (#4410, #4690) - Minor: Message input is now focused when clicking on emotes. (#4719) - Minor: Changed viewer list to chatter list to more match Twitch's terminology. (#4732) -- Minor: Added better support for Twitch's Hype Chat feature. (#4715) +- Minor: Added currency & duration to Hype Chat messages. (#4715) +- Minor: Added `is:hype-chat` search option. (#4766) +- Minor: Added `flags.hype_chat` filter variable. (#4766) - Minor: Nicknames are now taken into consideration when searching for messages. (#4663, #4742) - Minor: Added a message for when Chatterino joins a channel (#4616) - Minor: 7TV badges now automatically update upon changing them. (#4512) diff --git a/src/controllers/filters/lang/Filter.cpp b/src/controllers/filters/lang/Filter.cpp index 99b569c3c..d418907ef 100644 --- a/src/controllers/filters/lang/Filter.cpp +++ b/src/controllers/filters/lang/Filter.cpp @@ -96,6 +96,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.hype_chat", 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)}, diff --git a/src/controllers/filters/lang/Filter.hpp b/src/controllers/filters/lang/Filter.hpp index 6b492a6a1..6ebfdb944 100644 --- a/src/controllers/filters/lang/Filter.hpp +++ b/src/controllers/filters/lang/Filter.hpp @@ -39,6 +39,7 @@ static const QMap MESSAGE_TYPING_CONTEXT = { {"flags.reward_message", Type::Bool}, {"flags.first_message", Type::Bool}, {"flags.elevated_message", Type::Bool}, + {"flags.hype_chat", Type::Bool}, {"flags.cheer_message", Type::Bool}, {"flags.whisper", Type::Bool}, {"flags.reply", Type::Bool}, diff --git a/src/controllers/filters/lang/Tokenizer.hpp b/src/controllers/filters/lang/Tokenizer.hpp index 63c310b01..567c8d132 100644 --- a/src/controllers/filters/lang/Tokenizer.hpp +++ b/src/controllers/filters/lang/Tokenizer.hpp @@ -24,7 +24,10 @@ static const QMap validIdentifiersMap = { {"flags.system_message", "system message?"}, {"flags.reward_message", "channel point reward message?"}, {"flags.first_message", "first message?"}, - {"flags.elevated_message", "elevated message?"}, + {"flags.elevated_message", "hype chat message?"}, + // Ideally these values are unique, because ChannelFilterEditorDialog::ValueSpecifier::expressionText depends on + // std::map layout in Qt 6 and internal implementation in Qt 5. + {"flags.hype_chat", "hype chat message?"}, {"flags.cheer_message", "cheer message?"}, {"flags.whisper", "whisper message?"}, {"flags.reply", "reply message?"}, diff --git a/src/controllers/highlights/HighlightModel.cpp b/src/controllers/highlights/HighlightModel.cpp index b49f6fbb4..7c7b08e9b 100644 --- a/src/controllers/highlights/HighlightModel.cpp +++ b/src/controllers/highlights/HighlightModel.cpp @@ -178,13 +178,12 @@ void HighlightModel::afterInit() this->insertCustomRow(firstMessageRow, HighlightRowIndexes::FirstMessageRow); - // Highlight settings for elevated messages + // Highlight settings for hype chats std::vector elevatedMessageRow = this->createRow(); setBoolItem(elevatedMessageRow[Column::Pattern], getSettings()->enableElevatedMessageHighlight.getValue(), true, false); - elevatedMessageRow[Column::Pattern]->setData("Elevated Messages", - Qt::DisplayRole); + elevatedMessageRow[Column::Pattern]->setData("Hype Chats", Qt::DisplayRole); elevatedMessageRow[Column::ShowInMentions]->setFlags({}); // setBoolItem(elevatedMessageRow[Column::FlashTaskbar], // getSettings()->enableElevatedMessageHighlightTaskbar.getValue(), diff --git a/src/messages/search/MessageFlagsPredicate.cpp b/src/messages/search/MessageFlagsPredicate.cpp index 9bcee9843..c15257699 100644 --- a/src/messages/search/MessageFlagsPredicate.cpp +++ b/src/messages/search/MessageFlagsPredicate.cpp @@ -35,7 +35,7 @@ MessageFlagsPredicate::MessageFlagsPredicate(const QString &flags, bool negate) { this->flags_.set(MessageFlag::FirstMessage); } - else if (flag == "elevated-msg") + else if (flag == "elevated-msg" || flag == "hype-chat") { this->flags_.set(MessageFlag::ElevatedMessage); } diff --git a/src/util/SampleData.cpp b/src/util/SampleData.cpp index 74c0b1850..953646139 100644 --- a/src/util/SampleData.cpp +++ b/src/util/SampleData.cpp @@ -107,7 +107,7 @@ const QStringList &getSampleMiscMessages() // mod announcement R"(@badge-info=subscriber/47;badges=broadcaster/1,subscriber/3012,twitchconAmsterdam2020/1;color=#FF0000;display-name=Supinic;emotes=;flags=;id=8c26e1ab-b50c-4d9d-bc11-3fd57a941d90;login=supinic;mod=0;msg-id=announcement;msg-param-color=PRIMARY;room-id=31400525;subscriber=1;system-msg=;tmi-sent-ts=1648762219962;user-id=31400525;user-type= :tmi.twitch.tv USERNOTICE #supinic :mm test lol)", - // Elevated Message (Paid option for keeping a message in chat longer) + // Hype Chat (Paid option for keeping a message in chat longer) // no level R"(@badge-info=subscriber/3;badges=subscriber/0,bits-charity/1;color=#0000FF;display-name=SnoopyTheBot;emotes=;first-msg=0;flags=;id=8779a9e5-cf1b-47b3-b9fe-67a5b1b605f6;mod=0;pinned-chat-paid-amount=500;pinned-chat-paid-canonical-amount=5;pinned-chat-paid-currency=USD;pinned-chat-paid-exponent=2;returning-chatter=0;room-id=36340781;subscriber=1;tmi-sent-ts=1664505974154;turbo=0;user-id=136881249;user-type= :snoopythebot!snoopythebot@snoopythebot.tmi.twitch.tv PRIVMSG #pajlada :-$5)", // level 1