signal-desktop/ts/util/isSignalConversation.ts
2024-11-27 14:11:53 -08:00

22 lines
597 B
TypeScript

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { SIGNAL_ACI } from '../types/SignalConversation';
import type { ServiceIdString } from '../types/ServiceId';
export function isSignalConversation(conversation: {
id: string;
serviceId?: ServiceIdString;
}): boolean {
const { id, serviceId } = conversation;
if (serviceId) {
return serviceId === SIGNAL_ACI;
}
return window.ConversationController.isSignalConversationId(id);
}
export function isSignalServiceId(serviceId: ServiceIdString): boolean {
return serviceId === SIGNAL_ACI;
}