Use ContactRecord.systemNickname

This commit is contained in:
Fedor Indutny 2023-02-13 14:40:11 -08:00 committed by GitHub
parent 949efca190
commit 1f95c2299e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 91 additions and 57 deletions

View file

@ -49,7 +49,16 @@ export function getTitleNoDefault(
export function canHaveUsername(
attributes: Pick<
ConversationAttributesType,
'id' | 'type' | 'name' | 'profileName' | 'profileFamilyName' | 'e164'
| 'id'
| 'type'
| 'name'
| 'profileName'
| 'profileFamilyName'
| 'e164'
| 'systemGivenName'
| 'systemFamilyName'
| 'systemNickname'
| 'type'
>,
ourConversationId: string | undefined
): boolean {
@ -84,13 +93,13 @@ export function getProfileName(
export function getSystemName(
attributes: Pick<
ConversationAttributesType,
'systemGivenName' | 'systemFamilyName' | 'type'
'systemGivenName' | 'systemFamilyName' | 'systemNickname' | 'type'
>
): string | undefined {
if (isDirectConversation(attributes)) {
return combineNames(
attributes.systemGivenName,
attributes.systemFamilyName
return (
attributes.systemNickname ||
combineNames(attributes.systemGivenName, attributes.systemFamilyName)
);
}