feat: add ability to limit message snapshot size (#6602)
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user