feat: add ability to limit message snapshot size (#6602)

Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2025-11-26 23:35:34 +01:00
committed by GitHub
parent 118e1781dd
commit c4dd5f43ce
7 changed files with 93 additions and 11 deletions
@@ -154,13 +154,9 @@ void NotificationController::notifyTwitchChannelLive(
void NotificationController::notifyTwitchChannelOffline(const QString &id) const
{
// "delete" old 'CHANNEL is live' message
LimitedQueueSnapshot<MessagePtr> snapshot =
getApp()->getTwitch()->getLiveChannel()->getMessageSnapshot();
int snapshotLength = static_cast<int>(snapshot.size());
int end = std::max(0, snapshotLength - 200);
for (int i = snapshotLength - 1; i >= end; --i)
const LimitedQueueSnapshot<MessagePtr> snapshot =
getApp()->getTwitch()->getLiveChannel()->getMessageSnapshot(200);
for (size_t i = snapshot.size() - 1; i >= 0; --i)
{
const auto &s = snapshot[i];