mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix Twitch-Specific Filters Not Being Applied (#4529)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
b3ade53229
commit
610394d696
|
@ -19,6 +19,7 @@
|
||||||
- Bugfix: Fixed blocked user list sticking around when switching from a logged in user to being logged out. (#4437)
|
- Bugfix: Fixed blocked user list sticking around when switching from a logged in user to being logged out. (#4437)
|
||||||
- Bugfix: Fixed search popup ignoring setting for message scrollback limit. (#4496)
|
- Bugfix: Fixed search popup ignoring setting for message scrollback limit. (#4496)
|
||||||
- Bugfix: Fixed a memory leak that occurred when loading message history. This was mostly noticeable with unstable internet connections where reconnections were frequent or long-running instances of Chatterino. (#4499)
|
- Bugfix: Fixed a memory leak that occurred when loading message history. This was mostly noticeable with unstable internet connections where reconnections were frequent or long-running instances of Chatterino. (#4499)
|
||||||
|
- Bugfix: Fixed Twitch channel-specific filters not being applied correctly. (#4529)
|
||||||
- Bugfix: Fixed emote & badge tooltips not showing up when thumbnails were hidden. (#4509)
|
- Bugfix: Fixed emote & badge tooltips not showing up when thumbnails were hidden. (#4509)
|
||||||
- Dev: Disabling precompiled headers on Windows is now tested in CI. (#4472)
|
- Dev: Disabling precompiled headers on Windows is now tested in CI. (#4472)
|
||||||
- Dev: Themes are now stored as JSON files in `resources/themes`. (#4471, #4533)
|
- Dev: Themes are now stored as JSON files in `resources/themes`. (#4471, #4533)
|
||||||
|
|
|
@ -575,7 +575,7 @@ void TwitchChannel::setRoomModes(const RoomModes &_roomModes)
|
||||||
|
|
||||||
bool TwitchChannel::isLive() const
|
bool TwitchChannel::isLive() const
|
||||||
{
|
{
|
||||||
return this->streamStatus_.access()->live;
|
return this->streamStatus_.accessConst()->live;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedAccessGuard<const TwitchChannel::StreamStatus>
|
SharedAccessGuard<const TwitchChannel::StreamStatus>
|
||||||
|
@ -911,88 +911,85 @@ int TwitchChannel::chatterCount()
|
||||||
|
|
||||||
void TwitchChannel::setLive(bool newLiveStatus)
|
void TwitchChannel::setLive(bool newLiveStatus)
|
||||||
{
|
{
|
||||||
bool gotNewLiveStatus = false;
|
|
||||||
{
|
{
|
||||||
auto guard = this->streamStatus_.access();
|
auto guard = this->streamStatus_.access();
|
||||||
if (guard->live != newLiveStatus)
|
if (guard->live == newLiveStatus)
|
||||||
{
|
{
|
||||||
gotNewLiveStatus = true;
|
return;
|
||||||
if (newLiveStatus)
|
}
|
||||||
|
guard->live = newLiveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newLiveStatus)
|
||||||
|
{
|
||||||
|
if (getApp()->notifications->isChannelNotified(this->getName(),
|
||||||
|
Platform::Twitch))
|
||||||
|
{
|
||||||
|
if (Toasts::isEnabled())
|
||||||
{
|
{
|
||||||
if (getApp()->notifications->isChannelNotified(
|
getApp()->toasts->sendChannelNotification(
|
||||||
this->getName(), Platform::Twitch))
|
this->getName(), this->accessStreamStatus()->title,
|
||||||
{
|
Platform::Twitch);
|
||||||
if (Toasts::isEnabled())
|
|
||||||
{
|
|
||||||
getApp()->toasts->sendChannelNotification(
|
|
||||||
this->getName(), guard->title, Platform::Twitch);
|
|
||||||
}
|
|
||||||
if (getSettings()->notificationPlaySound)
|
|
||||||
{
|
|
||||||
getApp()->notifications->playSound();
|
|
||||||
}
|
|
||||||
if (getSettings()->notificationFlashTaskbar)
|
|
||||||
{
|
|
||||||
getApp()->windows->sendAlert();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Channel live message
|
|
||||||
MessageBuilder builder;
|
|
||||||
TwitchMessageBuilder::liveSystemMessage(this->getDisplayName(),
|
|
||||||
&builder);
|
|
||||||
this->addMessage(builder.release());
|
|
||||||
|
|
||||||
// Message in /live channel
|
|
||||||
MessageBuilder builder2;
|
|
||||||
TwitchMessageBuilder::liveMessage(this->getDisplayName(),
|
|
||||||
&builder2);
|
|
||||||
getApp()->twitch->liveChannel->addMessage(builder2.release());
|
|
||||||
|
|
||||||
// Notify on all channels with a ping sound
|
|
||||||
if (getSettings()->notificationOnAnyChannel &&
|
|
||||||
!(isInStreamerMode() &&
|
|
||||||
getSettings()->streamerModeSuppressLiveNotifications))
|
|
||||||
{
|
|
||||||
getApp()->notifications->playSound();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
if (getSettings()->notificationPlaySound)
|
||||||
{
|
{
|
||||||
// Channel offline message
|
getApp()->notifications->playSound();
|
||||||
MessageBuilder builder;
|
}
|
||||||
TwitchMessageBuilder::offlineSystemMessage(
|
if (getSettings()->notificationFlashTaskbar)
|
||||||
this->getDisplayName(), &builder);
|
{
|
||||||
this->addMessage(builder.release());
|
getApp()->windows->sendAlert();
|
||||||
|
}
|
||||||
// "delete" old 'CHANNEL is live' message
|
}
|
||||||
LimitedQueueSnapshot<MessagePtr> snapshot =
|
// Channel live message
|
||||||
getApp()->twitch->liveChannel->getMessageSnapshot();
|
MessageBuilder builder;
|
||||||
int snapshotLength = snapshot.size();
|
TwitchMessageBuilder::liveSystemMessage(this->getDisplayName(),
|
||||||
|
&builder);
|
||||||
// MSVC hates this code if the parens are not there
|
this->addMessage(builder.release());
|
||||||
int end = (std::max)(0, snapshotLength - 200);
|
|
||||||
auto liveMessageSearchText =
|
// Message in /live channel
|
||||||
QString("%1 is live!").arg(this->getDisplayName());
|
MessageBuilder builder2;
|
||||||
|
TwitchMessageBuilder::liveMessage(this->getDisplayName(), &builder2);
|
||||||
for (int i = snapshotLength - 1; i >= end; --i)
|
getApp()->twitch->liveChannel->addMessage(builder2.release());
|
||||||
{
|
|
||||||
auto &s = snapshot[i];
|
// Notify on all channels with a ping sound
|
||||||
|
if (getSettings()->notificationOnAnyChannel &&
|
||||||
if (s->messageText == liveMessageSearchText)
|
!(isInStreamerMode() &&
|
||||||
{
|
getSettings()->streamerModeSuppressLiveNotifications))
|
||||||
s->flags.set(MessageFlag::Disabled);
|
{
|
||||||
break;
|
getApp()->notifications->playSound();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Channel offline message
|
||||||
|
MessageBuilder builder;
|
||||||
|
TwitchMessageBuilder::offlineSystemMessage(this->getDisplayName(),
|
||||||
|
&builder);
|
||||||
|
this->addMessage(builder.release());
|
||||||
|
|
||||||
|
// "delete" old 'CHANNEL is live' message
|
||||||
|
LimitedQueueSnapshot<MessagePtr> snapshot =
|
||||||
|
getApp()->twitch->liveChannel->getMessageSnapshot();
|
||||||
|
int snapshotLength = snapshot.size();
|
||||||
|
|
||||||
|
// MSVC hates this code if the parens are not there
|
||||||
|
int end = (std::max)(0, snapshotLength - 200);
|
||||||
|
auto liveMessageSearchText =
|
||||||
|
QString("%1 is live!").arg(this->getDisplayName());
|
||||||
|
|
||||||
|
for (int i = snapshotLength - 1; i >= end; --i)
|
||||||
|
{
|
||||||
|
auto &s = snapshot[i];
|
||||||
|
|
||||||
|
if (s->messageText == liveMessageSearchText)
|
||||||
|
{
|
||||||
|
s->flags.set(MessageFlag::Disabled);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
guard->live = newLiveStatus;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gotNewLiveStatus)
|
this->liveStatusChanged.invoke();
|
||||||
{
|
|
||||||
this->liveStatusChanged.invoke();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwitchChannel::refreshTitle()
|
void TwitchChannel::refreshTitle()
|
||||||
|
|
|
@ -838,7 +838,7 @@ bool ChannelView::shouldIncludeMessage(const MessagePtr &m) const
|
||||||
m->loginName, Qt::CaseInsensitive) == 0)
|
m->loginName, Qt::CaseInsensitive) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return this->channelFilters_->filter(m, this->channel_);
|
return this->channelFilters_->filter(m, this->underlyingChannel_);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue