signal-desktop/ts/util/callingGetParticipantName.ts
2024-03-26 12:48:33 -07:00

25 lines
561 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationType } from '../state/ducks/conversations';
export function getParticipantName(
participant: Readonly<
Pick<
ConversationType,
| 'firstName'
| 'systemGivenName'
| 'systemNickname'
| 'title'
| 'nicknameGivenName'
>
>
): string {
return (
participant.nicknameGivenName ||
participant.systemNickname ||
participant.systemGivenName ||
participant.firstName ||
participant.title
);
}