highlighting whispers works better and looks better

This commit is contained in:
apa420
2018-08-29 01:21:36 +02:00
parent c5d5825b5a
commit c3065db16d
6 changed files with 75 additions and 33 deletions
+16 -9
View File
@@ -507,10 +507,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));
}
@@ -564,6 +564,19 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
}
}
}
if (this->args.isReceivedWhisper) {
if (getSettings()->enableWhisperHighlight) {
log("Highlight because it's a whisper",
this->args.isReceivedWhisper);
doHighlight = true;
}
if (getSettings()->enableWhisperHighlightTaskbar) {
doAlert = true;
}
if (getSettings()->enableSelfHighlightSound) {
playSound = true;
}
}
this->message().flags.set(MessageFlag::Highlighted, doHighlight);
@@ -578,12 +591,6 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
2500);
}
}
if (this->args.isReceivedWhisper &&
getSettings()->highlightSoundOnWhisper) {
if (!hasFocus || getSettings()->highlightAlwaysPlaySound) {
player->play();
}
}
}
}