Fix for unread syncs and ooo reactions

This commit is contained in:
Josh Perez 2021-03-12 20:22:36 -05:00 committed by Josh Perez
parent 55f0beaa6d
commit 62e04a1bbd
7 changed files with 178 additions and 102 deletions

View file

@ -69,12 +69,26 @@
if (message.isUnread()) {
await message.markRead(readAt, { skipSave: true });
// onReadMessage may result in messages older than this one being
// marked read. We want those messages to have the same expire timer
// start time as this one, so we pass the readAt value through.
const conversation = message.getConversation();
if (conversation) {
conversation.onReadMessage(message, readAt);
const updateConversation = () => {
// onReadMessage may result in messages older than this one being
// marked read. We want those messages to have the same expire timer
// start time as this one, so we pass the readAt value through.
const conversation = message.getConversation();
if (conversation) {
conversation.onReadMessage(message, readAt);
}
};
if (window.startupProcessingQueue) {
const conversation = message.getConversation();
if (conversation) {
window.startupProcessingQueue.add(
conversation.get('id'),
updateConversation
);
}
} else {
updateConversation();
}
} else {
const now = Date.now();