Make "discoverable by phone number" contingent upon having a phone number in the first place

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2026-07-29 14:40:08 -04:00
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) {