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

@ -19,13 +19,7 @@ export const parsePhoneNumberSharingMode = makeEnumParser(
PhoneNumberSharingMode.Everybody
);
export const shouldSharePhoneNumberWith = (
conversation: ConversationAttributesType
): boolean => {
if (!isDirectConversation(conversation) || isMe(conversation)) {
return false;
}
export const isSharingPhoneNumberWithEverybody = (): boolean => {
const phoneNumberSharingMode = parsePhoneNumberSharingMode(
window.storage.get('phoneNumberSharingMode')
);
@ -40,3 +34,13 @@ export const shouldSharePhoneNumberWith = (
throw missingCaseError(phoneNumberSharingMode);
}
};
export const shouldSharePhoneNumberWith = (
conversation: ConversationAttributesType
): boolean => {
if (!isDirectConversation(conversation) || isMe(conversation)) {
return false;
}
return isSharingPhoneNumberWithEverybody();
};