Fix sending to username

This commit is contained in:
AsamK 2024-02-18 20:58:55 +01:00
parent d84362eb0f
commit ed40d116b7
3 changed files with 10 additions and 3 deletions

View file

@ -19,7 +19,7 @@ public record RecipientAddress(Optional<UUID> uuid, Optional<String> number, Opt
public RecipientAddress {
uuid = uuid.isPresent() && uuid.get().equals(UNKNOWN_UUID) ? Optional.empty() : uuid;
if (uuid.isEmpty() && number.isEmpty() && username.isEmpty()) {
throw new AssertionError("Must have either a UUID or E164 number!");
throw new AssertionError("Must have either a UUID, username or E164 number!");
}
}

View file

@ -26,8 +26,8 @@ public record RecipientAddress(
if (pni.isPresent() && pni.get().isUnknown()) {
pni = Optional.empty();
}
if (aci.isEmpty() && pni.isEmpty() && number.isEmpty()) {
throw new AssertionError("Must have either a ServiceId or E164 number!");
if (aci.isEmpty() && pni.isEmpty() && number.isEmpty() && username.isEmpty()) {
throw new AssertionError("Must have either a ServiceId, username or E164 number!");
}
}