mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
25 lines
590 B
TypeScript
25 lines
590 B
TypeScript
// Copyright 2023 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { ConversationAttributesType } from '../model-types.d.ts';
|
|
import { isConversationMuted } from './isConversationMuted.std.js';
|
|
import { itemStorage } from '../textsecure/Storage.preload.js';
|
|
|
|
export function canConversationBeUnarchived(
|
|
attrs: ConversationAttributesType
|
|
): boolean {
|
|
if (!attrs.isArchived) {
|
|
return false;
|
|
}
|
|
|
|
if (!isConversationMuted(attrs)) {
|
|
return true;
|
|
}
|
|
|
|
if (itemStorage.get('keepMutedChatsArchived') ?? false) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|