Add highlighting of all messages from a certain user (#564)
* Rework to use controllers * Rework to use controllers * Add doHighlight * Cherry pick? * Fixes per PR * Remove file
This commit is contained in:
@@ -465,6 +465,7 @@ void TwitchMessageBuilder::parseHighlights()
|
||||
// TODO: This vector should only be rebuilt upon highlights being changed
|
||||
// fourtf: should be implemented in the HighlightsController
|
||||
std::vector<HighlightPhrase> activeHighlights = app->highlights->phrases.getVector();
|
||||
std::vector<HighlightPhrase> userHighlights = app->highlights->highlightedUsers.getVector();
|
||||
|
||||
if (app->settings->enableHighlightsSelf && currentUsername.size() > 0) {
|
||||
HighlightPhrase selfHighlight(currentUsername, app->settings->enableHighlightTaskbar,
|
||||
@@ -500,6 +501,26 @@ void TwitchMessageBuilder::parseHighlights()
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const HighlightPhrase &userHighlight : userHighlights) {
|
||||
if (userHighlight.isMatch(this->ircMessage->nick())) {
|
||||
Log("Highlight because user {} sent a message", this->ircMessage->nick());
|
||||
doHighlight = true;
|
||||
|
||||
if (userHighlight.getAlert()) {
|
||||
doAlert = true;
|
||||
}
|
||||
|
||||
if (userHighlight.getSound()) {
|
||||
playSound = true;
|
||||
}
|
||||
|
||||
if (playSound && doAlert) {
|
||||
// Break if no further action can be taken from other usernames
|
||||
// Mostly used for regex stuff
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->setHighlight(doHighlight);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user