Introduce TitleTransition notification

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-03-06 19:50:09 -06:00 committed by GitHub
commit edd2816fa4
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)
);
}