mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Interpret unknown phone number sharing setting as 'off'.
This commit is contained in:
committed by
Cody Henthorne
parent
c359ddf3c8
commit
879fca0e11
@@ -43,10 +43,9 @@ public final class PhoneNumberPrivacyValues extends SignalStoreValues {
|
||||
}
|
||||
|
||||
public boolean isPhoneNumberSharingEnabled() {
|
||||
// TODO [pnp] When we launch usernames, the default should return false
|
||||
return switch (getPhoneNumberSharingMode()) {
|
||||
case DEFAULT, EVERYBODY -> true;
|
||||
case NOBODY -> false;
|
||||
case EVERYBODY -> true;
|
||||
case DEFAULT, NOBODY -> false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -691,7 +691,7 @@ public class Recipient {
|
||||
* Whether or not we should show this user's e164 in the interface.
|
||||
*/
|
||||
public boolean shouldShowE164() {
|
||||
return hasE164() && (isSystemContact() || getPhoneNumberSharing() != PhoneNumberSharingState.DISABLED);
|
||||
return hasE164() && (isSystemContact() || getPhoneNumberSharing() == PhoneNumberSharingState.ENABLED);
|
||||
}
|
||||
|
||||
public @NonNull Optional<String> getEmail() {
|
||||
|
||||
@@ -65,9 +65,8 @@ public final class StorageSyncModels {
|
||||
}
|
||||
|
||||
public static AccountRecord.PhoneNumberSharingMode localToRemotePhoneNumberSharingMode(PhoneNumberPrivacyValues.PhoneNumberSharingMode phoneNumberPhoneNumberSharingMode) {
|
||||
// TODO [pnp] When we launch usernames, we want DEFAULT to map to NOBODY. In fact, we can just pass a boolean into this function instead of an enum.
|
||||
switch (phoneNumberPhoneNumberSharingMode) {
|
||||
case DEFAULT : return AccountRecord.PhoneNumberSharingMode.UNKNOWN;
|
||||
case DEFAULT : return AccountRecord.PhoneNumberSharingMode.NOBODY;
|
||||
case EVERYBODY: return AccountRecord.PhoneNumberSharingMode.EVERYBODY;
|
||||
case NOBODY : return AccountRecord.PhoneNumberSharingMode.NOBODY;
|
||||
default : throw new AssertionError();
|
||||
|
||||
Reference in New Issue
Block a user