mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Delete 'is live' messages from non-open channels (#3678)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
d85d9d4910
commit
00b463d298
|
@ -10,6 +10,7 @@
|
||||||
- Minor: Added chatter count for each category in viewer list. (#3683)
|
- Minor: Added chatter count for each category in viewer list. (#3683)
|
||||||
- Minor: Added option to open a user's chat in a new tab from the usercard profile picture context menu. (#3625)
|
- Minor: Added option to open a user's chat in a new tab from the usercard profile picture context menu. (#3625)
|
||||||
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
|
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
|
||||||
|
- Bugfix: Fixed live notifications not getting updated for closed streams going offline. (#3678)
|
||||||
- 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)
|
||||||
|
|
|
@ -249,6 +249,26 @@ void NotificationController::removeFakeChannel(const QString channelName)
|
||||||
if (i != fakeTwitchChannels.end())
|
if (i != fakeTwitchChannels.end())
|
||||||
{
|
{
|
||||||
fakeTwitchChannels.erase(i);
|
fakeTwitchChannels.erase(i);
|
||||||
|
// "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);
|
||||||
|
// this assumes that channelName is a login name therefore will only delete messages from fake channels
|
||||||
|
auto liveMessageSearchText = QString("%1 is live!").arg(channelName);
|
||||||
|
|
||||||
|
for (int i = snapshotLength - 1; i >= end; --i)
|
||||||
|
{
|
||||||
|
auto &s = snapshot[i];
|
||||||
|
|
||||||
|
if (s->messageText == liveMessageSearchText)
|
||||||
|
{
|
||||||
|
s->flags.set(MessageFlag::Disabled);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue