diff --git a/CHANGELOG.md b/CHANGELOG.md index 66152153e..ddf6b47f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - 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) - 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 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) diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index 2ac4b925d..a2f2c5ae2 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -249,6 +249,26 @@ void NotificationController::removeFakeChannel(const QString channelName) if (i != fakeTwitchChannels.end()) { fakeTwitchChannels.erase(i); + // "delete" old 'CHANNEL is live' message + LimitedQueueSnapshot 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; + } + } } }