mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-27 01:24:20 +01:00
Read phone number unlisted state from storage
This commit is contained in:
@@ -212,6 +212,7 @@ public class StorageHelper {
|
||||
default -> PhoneNumberSharingMode.CONTACTS;
|
||||
});
|
||||
}
|
||||
account.getConfigurationStore().setPhoneNumberUnlisted(accountRecord.isPhoneNumberUnlisted());
|
||||
|
||||
if (accountRecord.getProfileKey().isPresent()) {
|
||||
ProfileKey profileKey;
|
||||
|
||||
@@ -983,8 +983,7 @@ public class SignalAccount implements Closeable {
|
||||
}
|
||||
|
||||
public boolean isDiscoverableByPhoneNumber() {
|
||||
// TODO make configurable
|
||||
return true;
|
||||
return configurationStore.getPhoneNumberUnlisted() == null || !configurationStore.getPhoneNumberUnlisted();
|
||||
}
|
||||
|
||||
public void finishRegistration(final ACI aci, final MasterKey masterKey, final String pin) {
|
||||
|
||||
@@ -10,6 +10,7 @@ public class ConfigurationStore {
|
||||
private Boolean unidentifiedDeliveryIndicators;
|
||||
private Boolean typingIndicators;
|
||||
private Boolean linkPreviews;
|
||||
private Boolean phoneNumberUnlisted;
|
||||
private PhoneNumberSharingMode phoneNumberSharingMode;
|
||||
|
||||
public ConfigurationStore(final Saver saver) {
|
||||
@@ -62,6 +63,15 @@ public class ConfigurationStore {
|
||||
saver.save(toStorage());
|
||||
}
|
||||
|
||||
public Boolean getPhoneNumberUnlisted() {
|
||||
return phoneNumberUnlisted;
|
||||
}
|
||||
|
||||
public void setPhoneNumberUnlisted(final boolean phoneNumberUnlisted) {
|
||||
this.phoneNumberUnlisted = phoneNumberUnlisted;
|
||||
saver.save(toStorage());
|
||||
}
|
||||
|
||||
public PhoneNumberSharingMode getPhoneNumberSharingMode() {
|
||||
return phoneNumberSharingMode;
|
||||
}
|
||||
@@ -76,6 +86,7 @@ public class ConfigurationStore {
|
||||
unidentifiedDeliveryIndicators,
|
||||
typingIndicators,
|
||||
linkPreviews,
|
||||
phoneNumberUnlisted,
|
||||
phoneNumberSharingMode);
|
||||
}
|
||||
|
||||
@@ -84,6 +95,7 @@ public class ConfigurationStore {
|
||||
Boolean unidentifiedDeliveryIndicators,
|
||||
Boolean typingIndicators,
|
||||
Boolean linkPreviews,
|
||||
Boolean phoneNumberUnlisted,
|
||||
PhoneNumberSharingMode phoneNumberSharingMode
|
||||
) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user