Merge pull request #693 from apa420/apa-minor

Highlighting whispers works better and looks better
This commit is contained in:
pajlada
2018-08-29 10:22:16 +02:00
committed by GitHub
6 changed files with 71 additions and 33 deletions
+12 -9
View File
@@ -516,10 +516,10 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
std::vector<HighlightPhrase> userHighlights =
app->highlights->highlightedUsers.getVector();
if (getSettings()->enableHighlightsSelf && currentUsername.size() > 0) {
if (getSettings()->enableSelfHighlight && currentUsername.size() > 0) {
HighlightPhrase selfHighlight(
currentUsername, getSettings()->enableHighlightTaskbar,
getSettings()->enableHighlightSound, false);
currentUsername, getSettings()->enableSelfHighlightTaskbar,
getSettings()->enableSelfHighlightSound, false);
activeHighlights.emplace_back(std::move(selfHighlight));
}
@@ -573,6 +573,15 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
}
}
}
if (this->args.isReceivedWhisper &&
getSettings()->enableWhisperHighlight) {
if (getSettings()->enableWhisperHighlightTaskbar) {
doAlert = true;
}
if (getSettings()->enableWhisperHighlightSound) {
playSound = true;
}
}
this->message().flags.set(MessageFlag::Highlighted, doHighlight);
@@ -587,12 +596,6 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
2500);
}
}
if (this->args.isReceivedWhisper &&
getSettings()->highlightSoundOnWhisper) {
if (!hasFocus || getSettings()->highlightAlwaysPlaySound) {
player->play();
}
}
}
}