Skip to content

Commit

Permalink
Allow resub messages to show in /mentions tab (#3148)
Browse files Browse the repository at this point in the history
Co-authored-by: pajlada <[email protected]>
  • Loading branch information
jupjohn and pajlada authored Aug 15, 2021
1 parent 9a1e405 commit 4b251c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Minor: Remove TwitchEmotes.com attribution and the open/copy options when right-clicking a Twitch Emote. (#2214, #3136)
- Minor: Strip leading @ and trailing , from username in /user and /usercard commands. (#3143)
- Minor: Display a system message when reloading subscription emotes to match BTTV/FFZ behavior (#3135)
- Minor: Allow resub messages to show in `/mentions` tab (#3148)
- Minor: Added a setting to hide similar messages by any user. (#2716)
- Minor: Duplicate spaces now count towards the display message length. (#3002)
- Bugfix: Restored ability to send duplicate `/me` messages. (#3166)
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

0 comments on commit 4b251c6

Please sign in to comment.