mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Read phone number unlisted state from storage
This commit is contained in:
parent
4baf0849a6
commit
62dd5a169f
4 changed files with 33 additions and 2 deletions
|
@ -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
|
||||
) {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue