mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 06:46:47 +00:00
Make "discoverable by phone number" contingent upon having a phone number in the first place
This commit is contained in:
1 parent
4f4284d1cc
commit
70d0bda779
1 file changed
+8
-1
@@ -531,10 +531,17 @@ public class Account {
|
||||
this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess;
|
||||
}
|
||||
|
||||
/// Indicates whether this account may be discovered by its phone number via the contact discovery system (CDS).
|
||||
///
|
||||
/// @return `true` if this account has a phone number and has opted into discovery by phone number or `false`
|
||||
/// otherwise
|
||||
///
|
||||
/// @see #getPhoneNumberIdentifierOptional()
|
||||
/// @see #setDiscoverableByPhoneNumber(boolean)
|
||||
public boolean isDiscoverableByPhoneNumber() {
|
||||
requireNotStale();
|
||||
|
||||
return this.discoverableByPhoneNumber;
|
||||
return getPhoneNumberIdentifierOptional().isPresent() && this.discoverableByPhoneNumber;
|
||||
}
|
||||
|
||||
public void setDiscoverableByPhoneNumber(final boolean discoverableByPhoneNumber) {
|
||||
|
||||
Reference in new issue
Block a user