Support phone number sharing flag on profile

This commit is contained in:
Fedor Indutny 2024-01-02 20:36:49 +01:00 committed by GitHub
parent 23f39a0dc7
commit d71da5c486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 155 additions and 33 deletions

View file

@ -8,6 +8,7 @@ import type {
import { combineNames } from './combineNames';
import { getRegionCodeForNumber } from './libphonenumberUtil';
import { isDirectConversation } from './whatTypeOfConversation';
import { getE164 } from './getE164';
export function getTitle(
attributes: ConversationRenderInfoType,
@ -107,13 +108,16 @@ export function getSystemName(
}
export function getNumber(
attributes: Pick<ConversationAttributesType, 'e164' | 'type'>
attributes: Pick<
ConversationAttributesType,
'e164' | 'type' | 'notSharingPhoneNumber'
>
): string | undefined {
if (!isDirectConversation(attributes)) {
return '';
}
const { e164 } = attributes;
const e164 = getE164(attributes);
if (!e164) {
return '';
}