fix: use neutral or username color for reply messages (#5145)

This commit is contained in:
nerix
2024-02-03 10:25:16 +01:00
committed by GitHub
parent f960990492
commit f2eabacda1
4 changed files with 10 additions and 1 deletions
+2
View File
@@ -57,6 +57,8 @@ enum class MessageFlag : int64_t {
RestrictedMessage = (1LL << 33),
/// The message is sent by a user marked as monitor with Twitch's "Low Trust"/"Suspicious User" feature
MonitoredMessage = (1LL << 34),
/// The message is an ACTION message (/me)
Action = (1LL << 35),
};
using MessageFlags = FlagsEnum<MessageFlag>;
+1
View File
@@ -77,6 +77,7 @@ void SharedMessageBuilder::parse()
if (this->action_)
{
this->textColor_ = this->usernameColor_;
this->message().flags.set(MessageFlag::Action);
}
this->parseUsername();
@@ -896,11 +896,16 @@ void TwitchMessageBuilder::parseThread()
threadRoot->usernameColor, FontStyle::ChatMediumSmall)
->setLink({Link::UserInfo, threadRoot->displayName});
MessageColor color = MessageColor::Text;
if (threadRoot->flags.has(MessageFlag::Action))
{
color = threadRoot->usernameColor;
}
this->emplace<SingleLineTextElement>(
threadRoot->messageText,
MessageElementFlags({MessageElementFlag::RepliedMessage,
MessageElementFlag::Text}),
this->textColor_, FontStyle::ChatMediumSmall)
color, FontStyle::ChatMediumSmall)
->setLink({Link::ViewThread, this->thread_->rootId()});
}
else if (this->tags.find("reply-parent-msg-id") != this->tags.end())