Support phone number sharing flag on profile
This commit is contained in:
parent
23f39a0dc7
commit
d71da5c486
16 changed files with 155 additions and 33 deletions
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue