Change Elevated Messages to Hype Chats (#4766)

This commit is contained in:
Felanbird 2023-08-14 13:19:20 -04:00 committed by GitHub
parent 2d30ff62bf
commit 381d5c4276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 7 deletions

View file

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

View file

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

View file

@ -39,6 +39,7 @@ static const QMap<QString, Type> 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},

View file

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

View file

@ -178,13 +178,12 @@ void HighlightModel::afterInit()
this->insertCustomRow(firstMessageRow,
HighlightRowIndexes::FirstMessageRow);
// Highlight settings for elevated messages
// Highlight settings for hype chats
std::vector<QStandardItem *> 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(),

View file

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

View file

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