Merge pull request #3728 from thelounge/xpaw/active-buffer

Increase buffer size for active and scrolled down channels
This commit is contained in:
Pavel Djundik 2020-01-27 11:05:55 +02:00 committed by GitHub
commit 965b50a341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,8 +75,9 @@ socket.on("msg", function(data) {
// If message arrives in non active channel, keep only 100 messages // If message arrives in non active channel, keep only 100 messages
messageLimit = 100; messageLimit = 100;
} else if (channel.scrolledToBottom) { } else if (channel.scrolledToBottom) {
// If message arrives in active channel, keep 500 messages if scroll is currently at the bottom // If message arrives in active channel, keep 1500 messages if scroll is currently at the bottom
messageLimit = 500; // One history load may load up to 1000 messages at once if condendesed or hidden events are enabled
messageLimit = 1500;
} }
if (messageLimit > 0 && channel.messages.length > messageLimit) { if (messageLimit > 0 && channel.messages.length > messageLimit) {