Quote Everything Now + Handling more unread messages

This commit is contained in:
Adhiraj
2020-05-20 16:42:47 +05:30
parent 42a3d12236
commit a4903e77ed
7 changed files with 86 additions and 69 deletions

View File

@@ -124,12 +124,14 @@ module.exports = {
// de-register the callbacks, so that they don't get called again
this.deregisterCallback (["action", "add:last"])
this.deregisterCallback (["action", "add:before"])
this.deregisterCallback (["action", "add:unread"])
resolve ()
}
}
// wait for actual messages to load, "last" is the most recent message, "before" contains prior messages
this.registerCallback (["action", "add:last"], chatUpdate)
this.registerCallback (["action", "add:before"], chatUpdate)
this.registerCallback (["action", "add:unread"], chatUpdate)
})
const waitForChats = this.registerCallbackOneTime (["response", "type:chat"]).then (json => {
chats = json[2] // chats data (log json to see what it looks like)