mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Utilize RecipientIdCache during message processing.
This commit is contained in:
@@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.util.DelimiterUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -56,6 +57,20 @@ public class RecipientId implements Parcelable, Comparable<RecipientId> {
|
||||
return from(address.getUuid().orNull(), address.getNumber().orNull(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for when you have a string that could be either a UUID or an e164. This was primarily
|
||||
* created for interacting with protocol stores.
|
||||
* @param identifier A UUID or e164
|
||||
*/
|
||||
@AnyThread
|
||||
public static @NonNull RecipientId fromExternalPush(@NonNull String identifier) {
|
||||
if (UuidUtil.isUuid(identifier)) {
|
||||
return from(UuidUtil.parseOrThrow(identifier), null);
|
||||
} else {
|
||||
return from(null, identifier);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that the pairing is from a high-trust source.
|
||||
* See {@link Recipient#externalHighTrustPush(Context, SignalServiceAddress)}
|
||||
|
||||
Reference in New Issue
Block a user