mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Improve conversion of Recipient to SignalServiceAddress.
This commit is contained in:
committed by
Alex Hart
parent
1a21cafe6c
commit
5787a5f68a
@@ -268,7 +268,11 @@ public final class ProfileUtil {
|
||||
|
||||
private static @NonNull SignalServiceAddress toSignalServiceAddress(@NonNull Context context, @NonNull Recipient recipient) throws IOException {
|
||||
if (recipient.getRegistered() == RecipientDatabase.RegisteredState.NOT_REGISTERED) {
|
||||
return new SignalServiceAddress(recipient.getUuid().orNull(), recipient.getE164().orNull());
|
||||
if (recipient.hasUuid()) {
|
||||
return new SignalServiceAddress(recipient.requireUuid(), recipient.getE164().orNull());
|
||||
} else {
|
||||
throw new IOException(recipient.getId() + " not registered!");
|
||||
}
|
||||
} else {
|
||||
return RecipientUtil.toSignalServiceAddress(context, recipient);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user