mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix self-highlighting from resub messages (#3708)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
94f067ce62
commit
a5930f222a
|
@ -19,6 +19,7 @@
|
||||||
- Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679)
|
- Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679)
|
||||||
- Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686)
|
- Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686)
|
||||||
- Bugfix: Fixed incorrect spacing of settings icons at high DPI. (#3698)
|
- Bugfix: Fixed incorrect spacing of settings icons at high DPI. (#3698)
|
||||||
|
- Bugfix: Fixed highlights triggering from own resub messages. (#3707)
|
||||||
- Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713)
|
- Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713)
|
||||||
- Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718)
|
- Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718)
|
||||||
- Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)
|
- Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)
|
||||||
|
|
|
@ -130,41 +130,6 @@ void SharedMessageBuilder::parseHighlights()
|
||||||
{
|
{
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
// Highlight because it's a subscription
|
|
||||||
if (this->message().flags.has(MessageFlag::Subscription) &&
|
|
||||||
getSettings()->enableSubHighlight)
|
|
||||||
{
|
|
||||||
if (getSettings()->enableSubHighlightTaskbar)
|
|
||||||
{
|
|
||||||
this->highlightAlert_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getSettings()->enableSubHighlightSound)
|
|
||||||
{
|
|
||||||
this->highlightSound_ = true;
|
|
||||||
|
|
||||||
// Use custom sound if set, otherwise use fallback
|
|
||||||
if (!getSettings()->subHighlightSoundUrl.getValue().isEmpty())
|
|
||||||
{
|
|
||||||
this->highlightSoundUrl_ =
|
|
||||||
QUrl(getSettings()->subHighlightSoundUrl.getValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->highlightSoundUrl_ = getFallbackHighlightSound();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this->message().flags.set(MessageFlag::Highlighted);
|
|
||||||
this->message().highlightColor =
|
|
||||||
ColorProvider::instance().color(ColorType::Subscription);
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX: Non-common term in SharedMessageBuilder
|
|
||||||
auto currentUser = app->accounts->twitch.getCurrent();
|
|
||||||
|
|
||||||
QString currentUsername = currentUser->getUserName();
|
|
||||||
|
|
||||||
if (getCSettings().isBlacklistedUser(this->ircMessage->nick()))
|
if (getCSettings().isBlacklistedUser(this->ircMessage->nick()))
|
||||||
{
|
{
|
||||||
// Do nothing. We ignore highlights from this user.
|
// Do nothing. We ignore highlights from this user.
|
||||||
|
@ -258,12 +223,45 @@ void SharedMessageBuilder::parseHighlights()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto currentUser = app->accounts->twitch.getCurrent();
|
||||||
|
QString currentUsername = currentUser->getUserName();
|
||||||
|
|
||||||
if (this->ircMessage->nick() == currentUsername)
|
if (this->ircMessage->nick() == currentUsername)
|
||||||
{
|
{
|
||||||
// Do nothing. Highlights cannot be triggered by yourself
|
// Do nothing. Highlights cannot be triggered by yourself
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Highlight because it's a subscription
|
||||||
|
if (this->message().flags.has(MessageFlag::Subscription) &&
|
||||||
|
getSettings()->enableSubHighlight)
|
||||||
|
{
|
||||||
|
if (getSettings()->enableSubHighlightTaskbar)
|
||||||
|
{
|
||||||
|
this->highlightAlert_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getSettings()->enableSubHighlightSound)
|
||||||
|
{
|
||||||
|
this->highlightSound_ = true;
|
||||||
|
|
||||||
|
// Use custom sound if set, otherwise use fallback
|
||||||
|
if (!getSettings()->subHighlightSoundUrl.getValue().isEmpty())
|
||||||
|
{
|
||||||
|
this->highlightSoundUrl_ =
|
||||||
|
QUrl(getSettings()->subHighlightSoundUrl.getValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->highlightSoundUrl_ = getFallbackHighlightSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this->message().flags.set(MessageFlag::Highlighted);
|
||||||
|
this->message().highlightColor =
|
||||||
|
ColorProvider::instance().color(ColorType::Subscription);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This vector should only be rebuilt upon highlights being changed
|
// TODO: This vector should only be rebuilt upon highlights being changed
|
||||||
// fourtf: should be implemented in the HighlightsController
|
// fourtf: should be implemented in the HighlightsController
|
||||||
std::vector<HighlightPhrase> activeHighlights =
|
std::vector<HighlightPhrase> activeHighlights =
|
||||||
|
|
Loading…
Reference in a new issue