Don't mark messages as read when received in a hidden MUC

This commit is contained in:
JC Brand 2020-09-09 16:23:53 +02:00
parent ffbab33a26
commit 89d5c872b3

View File

@ -363,7 +363,7 @@ export const ChatBoxView = View.extend({
* - An optional message that serves as the cause for needing to scroll down. * - An optional message that serves as the cause for needing to scroll down.
*/ */
maybeScrollDown (message) { maybeScrollDown (message) {
if (message?.get('sender') === 'me' || !this.model.get('scrolled')) { if (message?.get('sender') === 'me' || !this.model.isHidden()) {
this.debouncedScrollDown(); this.debouncedScrollDown();
} }
}, },
@ -996,9 +996,7 @@ export const ChatBoxView = View.extend({
onScrolledDown () { onScrolledDown () {
this.hideNewMessagesIndicator(); this.hideNewMessagesIndicator();
if (_converse.windowState !== 'hidden') { (!this.model.isHidden()) && this.model.clearUnreadMsgCounter();
this.model.clearUnreadMsgCounter();
}
/** /**
* Triggered once the chat's message area has been scrolled down to the bottom. * Triggered once the chat's message area has been scrolled down to the bottom.
* @event _converse#chatBoxScrolledDown * @event _converse#chatBoxScrolledDown