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

Allow resub messages to show in /mentions tab #3148

Merged
merged 12 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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 @@ -7,6 +7,7 @@
- Minor: Display a system message when reloading subscription emotes to match BTTV/FFZ behavior (#3135)
- Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130)
- Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134)
- Bugfix: Allow resub messages to show in `/mentions` tab (#1013, #3148)
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)
- Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)

Expand Down
20 changes: 13 additions & 7 deletions src/messages/SharedMessageBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ void SharedMessageBuilder::parseHighlights()
this->message().flags.set(MessageFlag::Highlighted);
this->message().highlightColor =
ColorProvider::instance().color(ColorType::Subscription);

// This message was a subscription.
// Don't check for any other highlight phrases.
return;
}

// XXX: Non-common term in SharedMessageBuilder
Expand Down Expand Up @@ -220,7 +216,10 @@ void SharedMessageBuilder::parseHighlights()
<< "sent a message";

this->message().flags.set(MessageFlag::Highlighted);
this->message().highlightColor = userHighlight.getColor();
if (!this->message().flags.has(MessageFlag::Subscription))
{
this->message().highlightColor = userHighlight.getColor();
}

if (userHighlight.showInMentions())
{
Expand Down Expand Up @@ -289,7 +288,10 @@ void SharedMessageBuilder::parseHighlights()
}

this->message().flags.set(MessageFlag::Highlighted);
this->message().highlightColor = highlight.getColor();
if (!this->message().flags.has(MessageFlag::Subscription))
{
this->message().highlightColor = highlight.getColor();
}

if (highlight.showInMentions())
{
Expand Down Expand Up @@ -344,7 +346,11 @@ void SharedMessageBuilder::parseHighlights()
if (!badgeHighlightSet)
{
this->message().flags.set(MessageFlag::Highlighted);
this->message().highlightColor = highlight.getColor();
if (!this->message().flags.has(MessageFlag::Subscription))
{
this->message().highlightColor = highlight.getColor();
}

badgeHighlightSet = true;
}

Expand Down
7 changes: 2 additions & 5 deletions src/providers/twitch/IrcMessageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,9 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *_message,
const auto highlighted = msg->flags.has(MessageFlag::Highlighted);
const auto showInMentions = msg->flags.has(MessageFlag::ShowInMentions);

if (!isSub)
if (highlighted && showInMentions)
{
if (highlighted && showInMentions)
{
server.mentionsChannel->addMessage(msg);
}
server.mentionsChannel->addMessage(msg);
}

chan->addMessage(msg);
Expand Down