From 0888af4a6f058d0578329f91d1c536d3c0cbdc76 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 3 Nov 2021 16:31:12 +0100 Subject: [PATCH] Request more messages for event-playback infinite scrolling When the server supports draft/event-playback, some messages (like join/part/etc) may be collapsed together. Request more messages to avoid ending up with a half-filled page. --- components/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/app.js b/components/app.js index 9a9d5aa..c574e30 100644 --- a/components/app.js +++ b/components/app.js @@ -1224,7 +1224,12 @@ export default class App extends Component { // Avoids sending multiple CHATHISTORY commands in parallel this.endOfHistory.set(buf.id, true); - client.fetchHistoryBefore(buf.name, before, 100).then((result) => { + let limit = 100; + if (client.enabledCaps["draft/event-playback"]) { + limit = 200; + } + + client.fetchHistoryBefore(buf.name, before, limit).then((result) => { this.endOfHistory.set(buf.id, !result.more); }); }