Fix fix reading messages

This commit is contained in:
Eduard Kuzmenko 2020-11-26 11:51:38 +02:00
parent 7f8ae6c84f
commit 05c0595384

View File

@ -1726,6 +1726,16 @@ export class AppImManager {
bubble = document.createElement('div');
bubble.classList.add('bubble');
bubble.appendChild(bubbleContainer);
if(!our) {
//this.log('not our message', message, message.pFlags.unread);
if(message.pFlags.unread) {
this.unreadedObserver.observe(bubble);
if(!this.unreaded.indexOf(message.mid)) {
this.unreaded.push(message.mid);
}
}
}
} else {
const save = ['is-highlighted'];
const wasClassNames = bubble.className.split(' ');
@ -1778,16 +1788,6 @@ export class AppImManager {
this.renderMessagesQueue(message, bubble, reverse);
}
if(!our) {
//this.log('not our message', message, message.pFlags.unread);
if(message.pFlags.unread) {
this.unreadedObserver.observe(bubble);
if(!this.unreaded.indexOf(message.mid)) {
this.unreaded.push(message.mid);
}
}
}
return bubble;
}