2022-07-01 00:52:03 +00:00
|
|
|
// Copyright 2022 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import type { ConversationAttributesType } from '../model-types.d';
|
2023-08-10 16:43:33 +00:00
|
|
|
import type { ServiceIdString } from '../types/ServiceId';
|
2022-07-01 00:52:03 +00:00
|
|
|
|
|
|
|
export function getSendTarget({
|
2023-08-16 20:54:39 +00:00
|
|
|
serviceId,
|
2023-08-10 16:43:33 +00:00
|
|
|
pni,
|
2023-08-16 20:54:39 +00:00
|
|
|
}: Pick<ConversationAttributesType, 'serviceId' | 'pni'>):
|
2023-08-10 16:43:33 +00:00
|
|
|
| ServiceIdString
|
|
|
|
| undefined {
|
2023-08-16 20:54:39 +00:00
|
|
|
return serviceId || pni;
|
2022-07-01 00:52:03 +00:00
|
|
|
}
|