Generalize keepMutedChatsArchived check
This commit is contained in:
parent
f3b68677b3
commit
dff924c0c5
3 changed files with 27 additions and 7 deletions
|
@ -90,6 +90,7 @@ import {
|
|||
import { handleMessageSend } from '../util/handleMessageSend';
|
||||
import { getSendOptions } from '../util/getSendOptions';
|
||||
import { findAndFormatContact } from '../util/findAndFormatContact';
|
||||
import { canConversationBeUnarchived } from '../util/canConversationBeUnarchived';
|
||||
import {
|
||||
getAttachmentsForMessage,
|
||||
getMessagePropStatus,
|
||||
|
@ -3167,11 +3168,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
const isGroupStoryReply =
|
||||
isGroup(conversation.attributes) && message.get('storyId');
|
||||
|
||||
const keepMutedChatsArchived =
|
||||
window.storage.get('keepMutedChatsArchived') ?? false;
|
||||
const keepThisConversationArchived =
|
||||
keepMutedChatsArchived && conversation.isMuted();
|
||||
|
||||
if (readSyncs.length !== 0 || viewSyncs.length !== 0) {
|
||||
const markReadAt = Math.min(
|
||||
Date.now(),
|
||||
|
@ -3214,7 +3210,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
} else if (
|
||||
isFirstRun &&
|
||||
!isGroupStoryReply &&
|
||||
!keepThisConversationArchived
|
||||
canConversationBeUnarchived(conversation.attributes)
|
||||
) {
|
||||
conversation.setArchived(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue