Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
- Bugfix: Fixed popup windows not persisting between restarts. (#5081)
- Bugfix: Fixed splits not retaining their focus after minimizing. (#5080)
- 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: Change clang-format from v14 to v16. (#4929)
- Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791)
Expand Down
2 changes: 2 additions & 0 deletions src/messages/Message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>;

Expand Down
1 change: 1 addition & 0 deletions src/messages/SharedMessageBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void SharedMessageBuilder::parse()
if (this->action_)
{
this->textColor_ = this->usernameColor_;
this->message().flags.set(MessageFlag::Action);
}

this->parseUsername();
Expand Down
7 changes: 6 additions & 1 deletion src/providers/twitch/TwitchMessageBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Loading