Add highlight color and show in mentions to automod messages (#5215)

This commit is contained in:
KleberPF
2024-03-09 08:03:36 -03:00
committed by GitHub
parent ecad4b052a
commit c50791972d
13 changed files with 69 additions and 10 deletions
+8
View File
@@ -69,6 +69,14 @@ ScrollbarHighlight Message::getScrollBarHighlight() const
};
}
if (this->flags.has(MessageFlag::AutoModOffendingMessage) ||
this->flags.has(MessageFlag::AutoModOffendingMessageHeader))
{
return {
ColorProvider::instance().color(ColorType::AutomodHighlight),
};
}
return {};
}
+7 -5
View File
@@ -51,15 +51,17 @@ enum class MessageFlag : int64_t {
LiveUpdatesAdd = (1LL << 28),
LiveUpdatesRemove = (1LL << 29),
LiveUpdatesUpdate = (1LL << 30),
/// The header of a message caught by AutoMod containing allow/disallow
AutoModOffendingMessageHeader = (1LL << 31),
/// The message caught by AutoMod containing the user who sent the message & its contents
AutoModOffendingMessage = (1LL << 31),
LowTrustUsers = (1LL << 32),
AutoModOffendingMessage = (1LL << 32),
LowTrustUsers = (1LL << 33),
/// The message is sent by a user marked as restricted with Twitch's "Low Trust"/"Suspicious User" feature
RestrictedMessage = (1LL << 33),
RestrictedMessage = (1LL << 34),
/// The message is sent by a user marked as monitor with Twitch's "Low Trust"/"Suspicious User" feature
MonitoredMessage = (1LL << 34),
MonitoredMessage = (1LL << 35),
/// The message is an ACTION message (/me)
Action = (1LL << 35),
Action = (1LL << 36),
};
using MessageFlags = FlagsEnum<MessageFlag>;
+13 -1
View File
@@ -373,7 +373,19 @@ void MessageLayout::updateBuffer(QPixmap *buffer,
else if (this->message_->flags.has(MessageFlag::AutoMod) ||
this->message_->flags.has(MessageFlag::LowTrustUsers))
{
backgroundColor = QColor("#404040");
if (ctx.preferences.enableAutomodHighlight &&
(this->message_->flags.has(MessageFlag::AutoModOffendingMessage) ||
this->message_->flags.has(
MessageFlag::AutoModOffendingMessageHeader)))
{
backgroundColor = blendColors(
backgroundColor,
*ctx.colorProvider.color(ColorType::AutomodHighlight));
}
else
{
backgroundColor = QColor("#404040");
}
}
else if (this->message_->flags.has(MessageFlag::Debug))
{