Handle UUID-only recipients and merging.

This commit is contained in:
Greyson Parrelli
2020-07-15 18:03:18 -04:00
parent 644af87782
commit bd078fc883
23 changed files with 1026 additions and 237 deletions

View File

@@ -7,6 +7,7 @@
package org.whispersystems.signalservice.api.push;
import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.util.OptionalUtil;
import org.whispersystems.signalservice.api.util.UuidUtil;
import java.util.UUID;
@@ -43,8 +44,7 @@ public class SignalServiceAddress {
* Convenience constructor that will consider a UUID/E164 string absent if it is null or empty.
*/
public SignalServiceAddress(UUID uuid, String e164) {
this(Optional.fromNullable(uuid),
e164 != null && !e164.isEmpty() ? Optional.of(e164) : Optional.<String>absent());
this(Optional.fromNullable(uuid), OptionalUtil.absentIfEmpty(e164));
}
public SignalServiceAddress(Optional<UUID> uuid, Optional<String> e164) {