Handle CHATHISTORY messages when reaching end of batch
Closes: https://todo.sr.ht/~emersion/gamja/115
This commit is contained in:
parent
f45b51d981
commit
4a981997f0
2 changed files with 16 additions and 9 deletions
|
@ -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 };
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue