mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Add batch identity checks to stories and share/forward flows.
This commit is contained in:
@@ -112,7 +112,7 @@ public final class ProfileService {
|
||||
.onErrorReturn(ServiceResponse::forUnknownError);
|
||||
}
|
||||
|
||||
public @NonNull Single<ServiceResponse<IdentityCheckResponse>> performIdentityCheck(@Nonnull Map<ServiceId, IdentityKey> aciIdentityKeyMap, @Nonnull Optional<UnidentifiedAccess> unidentifiedAccess) {
|
||||
public @NonNull Single<ServiceResponse<IdentityCheckResponse>> performIdentityCheck(@Nonnull Map<ServiceId, IdentityKey> aciIdentityKeyMap) {
|
||||
List<AciFingerprintPair> aciKeyPairs = aciIdentityKeyMap.entrySet()
|
||||
.stream()
|
||||
.map(e -> new AciFingerprintPair(e.getKey(), e.getValue()))
|
||||
@@ -129,9 +129,9 @@ public final class ProfileService {
|
||||
|
||||
ResponseMapper<IdentityCheckResponse> responseMapper = DefaultResponseMapper.getDefault(IdentityCheckResponse.class);
|
||||
|
||||
return signalWebSocket.request(builder.build(), unidentifiedAccess)
|
||||
return signalWebSocket.request(builder.build(), Optional.empty())
|
||||
.map(responseMapper::map)
|
||||
.onErrorResumeNext(t -> performIdentityCheckRestFallback(request, unidentifiedAccess, responseMapper))
|
||||
.onErrorResumeNext(t -> performIdentityCheckRestFallback(request, Optional.empty(), responseMapper))
|
||||
.onErrorReturn(ServiceResponse::forUnknownError);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
import org.signal.libsignal.protocol.IdentityKey;
|
||||
import org.whispersystems.signalservice.api.push.ServiceId;
|
||||
import org.whispersystems.signalservice.api.push.ACI;
|
||||
import org.whispersystems.signalservice.internal.util.JsonUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -16,6 +16,13 @@ public class IdentityCheckResponse {
|
||||
@JsonProperty("elements")
|
||||
private List<AciIdentityPair> aciKeyPairs;
|
||||
|
||||
public IdentityCheckResponse() {}
|
||||
|
||||
// Visible for testing
|
||||
public IdentityCheckResponse(List<AciIdentityPair> aciKeyPairs) {
|
||||
this.aciKeyPairs = aciKeyPairs;
|
||||
}
|
||||
|
||||
public @Nullable List<AciIdentityPair> getAciKeyPairs() {
|
||||
return aciKeyPairs;
|
||||
}
|
||||
@@ -23,14 +30,22 @@ public class IdentityCheckResponse {
|
||||
public static final class AciIdentityPair {
|
||||
|
||||
@JsonProperty
|
||||
@JsonDeserialize(using = JsonUtil.ServiceIdDeserializer.class)
|
||||
private ServiceId aci;
|
||||
@JsonDeserialize(using = JsonUtil.AciDeserializer.class)
|
||||
private ACI aci;
|
||||
|
||||
@JsonProperty
|
||||
@JsonDeserialize(using = JsonUtil.IdentityKeyDeserializer.class)
|
||||
private IdentityKey identityKey;
|
||||
|
||||
public @Nullable ServiceId getAci() {
|
||||
public AciIdentityPair() {}
|
||||
|
||||
// Visible for testing
|
||||
public AciIdentityPair(ACI aci, IdentityKey identityKey) {
|
||||
this.aci = aci;
|
||||
this.identityKey = identityKey;
|
||||
}
|
||||
|
||||
public @Nullable ACI getAci() {
|
||||
return aci;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user