signal-desktop/ts/util/isBlocked.ts

22 lines
536 B
TypeScript
Raw Normal View History

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationAttributesType } from '../model-types';
export function isBlocked(attributes: ConversationAttributesType): boolean {
2023-08-16 20:54:39 +00:00
const { e164, groupId, serviceId } = attributes;
if (serviceId) {
return window.storage.blocked.isServiceIdBlocked(serviceId);
}
if (e164) {
return window.storage.blocked.isBlocked(e164);
}
if (groupId) {
return window.storage.blocked.isGroupBlocked(groupId);
}
return false;
}