mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-09-20 00:35:17 +01:00
37 lines
1000 B
TypeScript
37 lines
1000 B
TypeScript
// Copyright 2026 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { ConversationAttributesType } from '../model-types.d.ts';
|
|
import { itemStorage } from '../textsecure/Storage.preload.ts';
|
|
import type { NotifyWhileMuted } from './notifyWhileMuted.std.ts';
|
|
import {
|
|
DEFAULT_NOTIFY_IF_MUTED,
|
|
getNotifyWhileMuted,
|
|
} from './notifyWhileMuted.std.ts';
|
|
|
|
function getGlobalNotifyWhileMutedFromStorage(): NotifyWhileMuted {
|
|
return {
|
|
calls: itemStorage.get(
|
|
'notifyForCallsIfMuted',
|
|
DEFAULT_NOTIFY_IF_MUTED.calls
|
|
),
|
|
mentions: itemStorage.get(
|
|
'notifyForMentionsIfMuted',
|
|
DEFAULT_NOTIFY_IF_MUTED.mentions
|
|
),
|
|
replies: itemStorage.get(
|
|
'notifyForRepliesIfMuted',
|
|
DEFAULT_NOTIFY_IF_MUTED.replies
|
|
),
|
|
};
|
|
}
|
|
|
|
export function getNotifyWhileMutedForConversation(
|
|
attributes: ConversationAttributesType
|
|
): NotifyWhileMuted {
|
|
return getNotifyWhileMuted(
|
|
attributes,
|
|
getGlobalNotifyWhileMutedFromStorage()
|
|
);
|
|
}
|