Add highlights for first messages (#3267)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -119,6 +119,20 @@ void ColorProvider::initTypeColorMap()
|
||||
std::make_shared<QColor>(
|
||||
HighlightPhrase::FALLBACK_REDEEMED_HIGHLIGHT_COLOR)});
|
||||
}
|
||||
|
||||
customColor = getSettings()->firstMessageHighlightColor;
|
||||
if (QColor(customColor).isValid())
|
||||
{
|
||||
this->typeColorMap_.insert({ColorType::FirstMessageHighlight,
|
||||
std::make_shared<QColor>(customColor)});
|
||||
}
|
||||
else
|
||||
{
|
||||
this->typeColorMap_.insert(
|
||||
{ColorType::FirstMessageHighlight,
|
||||
std::make_shared<QColor>(
|
||||
HighlightPhrase::FALLBACK_FIRST_MESSAGE_HIGHLIGHT_COLOR)});
|
||||
}
|
||||
}
|
||||
|
||||
void ColorProvider::initDefaultColors()
|
||||
|
||||
@@ -11,7 +11,8 @@ enum class ColorType {
|
||||
SelfHighlight,
|
||||
Subscription,
|
||||
Whisper,
|
||||
RedeemedHighlight
|
||||
RedeemedHighlight,
|
||||
FirstMessageHighlight,
|
||||
};
|
||||
|
||||
class ColorProvider
|
||||
|
||||
@@ -180,6 +180,12 @@ MessagePtr TwitchMessageBuilder::build()
|
||||
this->message().flags.set(MessageFlag::RedeemedHighlight);
|
||||
}
|
||||
|
||||
if (this->tags.contains("first-msg") &&
|
||||
this->tags["first-msg"].toString() == "1")
|
||||
{
|
||||
this->message().flags.set(MessageFlag::FirstMessage);
|
||||
}
|
||||
|
||||
// timestamp
|
||||
this->emplace<TimestampElement>(
|
||||
calculateMessageTimestamp(this->ircMessage));
|
||||
|
||||
Reference in New Issue
Block a user