Remove UUIDs from GV1 membership lists.

This commit is contained in:
Greyson Parrelli
2020-07-27 16:37:08 -04:00
parent 1ab61beeb9
commit 5c110ca359
10 changed files with 60 additions and 59 deletions

View File

@@ -157,6 +157,20 @@ public class Recipient {
return externalPush(context, signalServiceAddress.getUuid().orNull(), signalServiceAddress.getNumber().orNull(), false);
}
/**
* Returns a fully-populated {@link Recipient} based off of a {@link SignalServiceAddress},
* creating one in the database if necessary. We special-case GV1 members because we want to
* prioritize E164 addresses and not use the UUIDs if possible.
*/
@WorkerThread
public static @NonNull Recipient externalGV1Member(@NonNull Context context, @NonNull SignalServiceAddress address) {
if (address.getNumber().isPresent()) {
return externalPush(context, null, address.getNumber().get(), false);
} else {
return externalPush(context, address.getUuid().orNull(), null, false);
}
}
/**
* Returns a fully-populated {@link Recipient} based off of a {@link SignalServiceAddress},
* creating one in the database if necessary. This should only used for high-trust sources,