Introduce TitleTransition notification

This commit is contained in:
Fedor Indutny 2024-03-06 15:59:51 -08:00 committed by GitHub
parent 09b5e6ef50
commit 3469a748fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 336 additions and 51 deletions

View file

@ -143,3 +143,30 @@ export function renderNumber(e164: string): string | undefined {
return undefined;
}
}
export function hasNumberTitle(
attributes: Pick<
ConversationAttributesType,
'e164' | 'type' | 'sharingPhoneNumber' | 'profileKey'
>
): boolean {
return (
!getSystemName(attributes) &&
!getProfileName(attributes) &&
Boolean(getNumber(attributes))
);
}
export function hasUsernameTitle(
attributes: Pick<
ConversationAttributesType,
'e164' | 'type' | 'sharingPhoneNumber' | 'profileKey' | 'username'
>
): boolean {
return (
!getSystemName(attributes) &&
!getProfileName(attributes) &&
!getNumber(attributes) &&
Boolean(attributes.username)
);
}