diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index f21426a7..bac7baa3 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -141,9 +141,7 @@ MessagePtr TwitchMessageBuilder::build() this->appendUsername(); // highlights - if (/*app->settings->enableHighlights &&*/ !isPastMsg) { - this->parseHighlights(); - } + this->parseHighlights(isPastMsg); QString bits; auto iterator = this->tags.find("bits"); @@ -420,7 +418,7 @@ void TwitchMessageBuilder::appendUsername() } } -void TwitchMessageBuilder::parseHighlights() +void TwitchMessageBuilder::parseHighlights(bool isPastMsg) { static auto player = new QMediaPlayer; static QUrl currentPlayerUrl; @@ -513,12 +511,14 @@ void TwitchMessageBuilder::parseHighlights() this->setHighlight(doHighlight); - if (playSound && (!hasFocus || app->settings->highlightAlwaysPlaySound)) { - player->play(); - } + if (!isPastMsg) { + if (playSound && (!hasFocus || app->settings->highlightAlwaysPlaySound)) { + player->play(); + } - if (doAlert) { - QApplication::alert(getApp()->windows->getMainWindow().window(), 2500); + if (doAlert) { + QApplication::alert(getApp()->windows->getMainWindow().window(), 2500); + } } if (doHighlight) { diff --git a/src/providers/twitch/TwitchMessageBuilder.hpp b/src/providers/twitch/TwitchMessageBuilder.hpp index 80d80fe7..b27ce8a0 100644 --- a/src/providers/twitch/TwitchMessageBuilder.hpp +++ b/src/providers/twitch/TwitchMessageBuilder.hpp @@ -48,7 +48,7 @@ private: void appendChannelName(); void parseUsername(); void appendUsername(); - void parseHighlights(); + void parseHighlights(bool isPastMsg); void appendTwitchEmote(const Communi::IrcMessage *ircMessage, const QString &emote, std::vector> &vec);