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.
This commit is contained in:
Simon Ser 2021-11-03 16:31:12 +01:00
parent 08cd94d775
commit 0888af4a6f

View File

@ -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);
});
}