forked from fair/matrix-puppeteer-line
Maybe fix message sorting
This commit is contained in:
parent
fc8bc79ffd
commit
935bc6bdb8
@ -393,6 +393,8 @@ class Portal(DBPortal, BasePortal):
|
||||
max_mid = await DBMessage.get_max_mid(self.mxid) or 0
|
||||
messages = [msg for msg in await source.client.get_messages(self.chat_id)
|
||||
if msg.id > max_mid]
|
||||
# TODO Confirm why sorting in Node isn't enough
|
||||
messages.sort(key=lambda message: message.id)
|
||||
|
||||
if not messages:
|
||||
self.log.debug("Didn't get any entries from server")
|
||||
|
@ -584,9 +584,7 @@ export default class MessagesPuppeteer {
|
||||
this.log("Waiting for messages to load")
|
||||
const messages = await this.page.evaluate(
|
||||
id => window.__mautrixController.parseMessageList(id), id)
|
||||
return messages.
|
||||
filter(msg => msg.id > minID && !this.sentMessageIDs.has(msg.id)).
|
||||
sort((a,b) => a.id - b.id) // TODO Confirm whether this sort is really needed
|
||||
return messages.filter(msg => msg.id > minID && !this.sentMessageIDs.has(msg.id))
|
||||
}
|
||||
|
||||
async _processChatListChangeUnsafe(id) {
|
||||
|
Loading…
Reference in New Issue
Block a user