Handle CHATHISTORY messages when reaching end of batch

Closes: https://todo.sr.ht/~emersion/gamja/115
This commit is contained in:
Simon Ser 2022-04-22 11:25:41 +02:00
parent f45b51d981
commit 4a981997f0
2 changed files with 16 additions and 9 deletions

View file

@ -886,7 +886,7 @@ export default class Client extends EventTarget {
let max = Math.min(limit, this.isupport.chatHistory());
let params = ["BEFORE", target, "timestamp=" + before, max];
return this.roundtripChatHistory(params).then((messages) => {
return { more: messages.length >= max };
return { messages, more: messages.length >= max };
});
}
@ -904,7 +904,7 @@ export default class Client extends EventTarget {
after.time = messages[messages.length - 1].tags.time;
return this.fetchHistoryBetween(target, after, before, limit);
}
return null;
return { messages };
});
}