mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix historical messages not triggering highlights
For now they only trigger the highlighting of the message, but not sound or flash alerts as I think that's weird. Fix #308
This commit is contained in:
parent
aaa82dce75
commit
da1627e47d
|
@ -141,9 +141,7 @@ MessagePtr TwitchMessageBuilder::build()
|
||||||
this->appendUsername();
|
this->appendUsername();
|
||||||
|
|
||||||
// highlights
|
// highlights
|
||||||
if (/*app->settings->enableHighlights &&*/ !isPastMsg) {
|
this->parseHighlights(isPastMsg);
|
||||||
this->parseHighlights();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString bits;
|
QString bits;
|
||||||
auto iterator = this->tags.find("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 auto player = new QMediaPlayer;
|
||||||
static QUrl currentPlayerUrl;
|
static QUrl currentPlayerUrl;
|
||||||
|
@ -513,12 +511,14 @@ void TwitchMessageBuilder::parseHighlights()
|
||||||
|
|
||||||
this->setHighlight(doHighlight);
|
this->setHighlight(doHighlight);
|
||||||
|
|
||||||
if (playSound && (!hasFocus || app->settings->highlightAlwaysPlaySound)) {
|
if (!isPastMsg) {
|
||||||
player->play();
|
if (playSound && (!hasFocus || app->settings->highlightAlwaysPlaySound)) {
|
||||||
}
|
player->play();
|
||||||
|
}
|
||||||
|
|
||||||
if (doAlert) {
|
if (doAlert) {
|
||||||
QApplication::alert(getApp()->windows->getMainWindow().window(), 2500);
|
QApplication::alert(getApp()->windows->getMainWindow().window(), 2500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doHighlight) {
|
if (doHighlight) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ private:
|
||||||
void appendChannelName();
|
void appendChannelName();
|
||||||
void parseUsername();
|
void parseUsername();
|
||||||
void appendUsername();
|
void appendUsername();
|
||||||
void parseHighlights();
|
void parseHighlights(bool isPastMsg);
|
||||||
|
|
||||||
void appendTwitchEmote(const Communi::IrcMessage *ircMessage, const QString &emote,
|
void appendTwitchEmote(const Communi::IrcMessage *ircMessage, const QString &emote,
|
||||||
std::vector<std::pair<long, EmoteData>> &vec);
|
std::vector<std::pair<long, EmoteData>> &vec);
|
||||||
|
|
Loading…
Reference in a new issue