fix: use neutral or username color for reply messages (#5145)
This commit is contained in:
@@ -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>;
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user