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
16 changed files with 155 additions and 33 deletions
+11 -7
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();
};