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
7 changed files with 13 additions and 7 deletions
+1
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)},
+1
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},
+4 -1
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?"},
@@ -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(),