Merge remote-tracking branch 'origin/master' into Manfred/master

This commit is contained in:
Rasmus Karlsson 2024-02-03 10:29:09 +01:00
commit 1136ad33d6
4 changed files with 10 additions and 1 deletions

View file

@ -74,6 +74,7 @@
- Bugfix: Fixed popup windows not persisting between restarts. (#5081) - Bugfix: Fixed popup windows not persisting between restarts. (#5081)
- Bugfix: Fixed splits not retaining their focus after minimizing. (#5080) - Bugfix: Fixed splits not retaining their focus after minimizing. (#5080)
- Bugfix: Fixed _Copy message_ copying the channel name in global search. (#5106) - Bugfix: Fixed _Copy message_ copying the channel name in global search. (#5106)
- Bugfix: Reply contexts now use the color of the replied-to message. (#5145)
- Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978) - Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978)
- Dev: Change clang-format from v14 to v16. (#4929) - Dev: Change clang-format from v14 to v16. (#4929)
- Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791) - Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791)

View file

@ -57,6 +57,8 @@ enum class MessageFlag : int64_t {
RestrictedMessage = (1LL << 33), RestrictedMessage = (1LL << 33),
/// The message is sent by a user marked as monitor with Twitch's "Low Trust"/"Suspicious User" feature /// The message is sent by a user marked as monitor with Twitch's "Low Trust"/"Suspicious User" feature
MonitoredMessage = (1LL << 34), MonitoredMessage = (1LL << 34),
/// The message is an ACTION message (/me)
Action = (1LL << 35),
}; };
using MessageFlags = FlagsEnum<MessageFlag>; using MessageFlags = FlagsEnum<MessageFlag>;

View file

@ -77,6 +77,7 @@ void SharedMessageBuilder::parse()
if (this->action_) if (this->action_)
{ {
this->textColor_ = this->usernameColor_; this->textColor_ = this->usernameColor_;
this->message().flags.set(MessageFlag::Action);
} }
this->parseUsername(); this->parseUsername();

View file

@ -896,11 +896,16 @@ void TwitchMessageBuilder::parseThread()
threadRoot->usernameColor, FontStyle::ChatMediumSmall) threadRoot->usernameColor, FontStyle::ChatMediumSmall)
->setLink({Link::UserInfo, threadRoot->displayName}); ->setLink({Link::UserInfo, threadRoot->displayName});
MessageColor color = MessageColor::Text;
if (threadRoot->flags.has(MessageFlag::Action))
{
color = threadRoot->usernameColor;
}
this->emplace<SingleLineTextElement>( this->emplace<SingleLineTextElement>(
threadRoot->messageText, threadRoot->messageText,
MessageElementFlags({MessageElementFlag::RepliedMessage, MessageElementFlags({MessageElementFlag::RepliedMessage,
MessageElementFlag::Text}), MessageElementFlag::Text}),
this->textColor_, FontStyle::ChatMediumSmall) color, FontStyle::ChatMediumSmall)
->setLink({Link::ViewThread, this->thread_->rootId()}); ->setLink({Link::ViewThread, this->thread_->rootId()});
} }
else if (this->tags.find("reply-parent-msg-id") != this->tags.end()) else if (this->tags.find("reply-parent-msg-id") != this->tags.end())