Files
Desktop/ts/util/callingGetParticipantName.std.ts
Fedor Indutny 44076ece79 Rename files
2025-10-16 23:45:44 -07:00

26 lines
572 B
TypeScript

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