diff --git a/CHANGELOG.md b/CHANGELOG.md index 6789f29e0..8f7ebc7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679) - Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686) - Bugfix: Fixed incorrect spacing of settings icons at high DPI. (#3698) +- Bugfix: Fixed highlights triggering from own resub messages. (#3707) - Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713) - Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718) - Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662) diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index bce590e38..fdcf9dcc4 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -130,41 +130,6 @@ void SharedMessageBuilder::parseHighlights() { auto app = getApp(); - // Highlight because it's a subscription - if (this->message().flags.has(MessageFlag::Subscription) && - getSettings()->enableSubHighlight) - { - if (getSettings()->enableSubHighlightTaskbar) - { - this->highlightAlert_ = true; - } - - if (getSettings()->enableSubHighlightSound) - { - this->highlightSound_ = true; - - // Use custom sound if set, otherwise use fallback - if (!getSettings()->subHighlightSoundUrl.getValue().isEmpty()) - { - this->highlightSoundUrl_ = - QUrl(getSettings()->subHighlightSoundUrl.getValue()); - } - else - { - this->highlightSoundUrl_ = getFallbackHighlightSound(); - } - } - - this->message().flags.set(MessageFlag::Highlighted); - this->message().highlightColor = - ColorProvider::instance().color(ColorType::Subscription); - } - - // XXX: Non-common term in SharedMessageBuilder - auto currentUser = app->accounts->twitch.getCurrent(); - - QString currentUsername = currentUser->getUserName(); - if (getCSettings().isBlacklistedUser(this->ircMessage->nick())) { // Do nothing. We ignore highlights from this user. @@ -258,12 +223,45 @@ void SharedMessageBuilder::parseHighlights() } } + auto currentUser = app->accounts->twitch.getCurrent(); + QString currentUsername = currentUser->getUserName(); + if (this->ircMessage->nick() == currentUsername) { // Do nothing. Highlights cannot be triggered by yourself return; } + // Highlight because it's a subscription + if (this->message().flags.has(MessageFlag::Subscription) && + getSettings()->enableSubHighlight) + { + if (getSettings()->enableSubHighlightTaskbar) + { + this->highlightAlert_ = true; + } + + if (getSettings()->enableSubHighlightSound) + { + this->highlightSound_ = true; + + // Use custom sound if set, otherwise use fallback + if (!getSettings()->subHighlightSoundUrl.getValue().isEmpty()) + { + this->highlightSoundUrl_ = + QUrl(getSettings()->subHighlightSoundUrl.getValue()); + } + else + { + this->highlightSoundUrl_ = getFallbackHighlightSound(); + } + } + + this->message().flags.set(MessageFlag::Highlighted); + this->message().highlightColor = + ColorProvider::instance().color(ColorType::Subscription); + } + // TODO: This vector should only be rebuilt upon highlights being changed // fourtf: should be implemented in the HighlightsController std::vector activeHighlights =