]> nmode's Git Repositories - signal-cli/commitdiff
Fix default value for phone number sharing mode
authorAsamK <asamk@gmx.de>
Mon, 29 Aug 2022 17:31:07 +0000 (19:31 +0200)
committerAsamK <asamk@gmx.de>
Mon, 29 Aug 2022 17:31:30 +0000 (19:31 +0200)
Fixes #1002

lib/src/main/java/org/asamk/signal/manager/helper/UnidentifiedAccessHelper.java
lib/src/main/java/org/asamk/signal/manager/storage/SignalAccount.java

index bdd6221b6a3abf96ba67fd28c994f373ac102a85..b89ed2b7d2a581ebc5de9cdf91394d7e99221157 100644 (file)
@@ -96,7 +96,7 @@ public class UnidentifiedAccessHelper {
 
     private byte[] getSenderCertificateFor(final RecipientId recipientId) {
         final var sharingMode = account.getConfigurationStore().getPhoneNumberSharingMode();
-        if (sharingMode == PhoneNumberSharingMode.EVERYBODY || (
+        if (sharingMode == null || sharingMode == PhoneNumberSharingMode.EVERYBODY || (
                 sharingMode == PhoneNumberSharingMode.CONTACTS
                         && account.getContactStore().getContact(recipientId) != null
         )) {
index 72f6f3d5b5a5eae8e2d9ec930fbdb3793fa7a691..279f6ee84c1e0360e558ebd881da17a5fddf2795 100644 (file)
@@ -1545,7 +1545,8 @@ public class SignalAccount implements Closeable {
     }
 
     public boolean isDiscoverableByPhoneNumber() {
-        return configurationStore.getPhoneNumberUnlisted() == null || !configurationStore.getPhoneNumberUnlisted();
+        final var phoneNumberUnlisted = configurationStore.getPhoneNumberUnlisted();
+        return phoneNumberUnlisted == null || !phoneNumberUnlisted;
     }
 
     public void finishRegistration(final ACI aci, final PNI pni, final MasterKey masterKey, final String pin) {