mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Support phone number sharing flag on profile
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user