Remove now-unnecessary data from prekey upload request.
This commit is contained in:
parent
6d150aa5cb
commit
b2cdb46c84
6 changed files with 2 additions and 18 deletions
|
@ -264,7 +264,6 @@ class ChangeNumberRepository(
|
|||
accountManager.setPreKeys(
|
||||
PreKeyUpload(
|
||||
serviceIdType = ServiceIdType.PNI,
|
||||
identityKey = pniProtocolStore.identityKeyPair.publicKey,
|
||||
signedPreKey = signedPreKey,
|
||||
oneTimeEcPreKeys = oneTimePreKeys,
|
||||
lastResortKyberPreKey = null,
|
||||
|
|
|
@ -146,7 +146,6 @@ class PreKeysSyncJob private constructor(parameters: Parameters) : BaseJob(param
|
|||
accountManager.setPreKeys(
|
||||
PreKeyUpload(
|
||||
serviceIdType = serviceIdType,
|
||||
identityKey = protocolStore.identityKeyPair.publicKey,
|
||||
signedPreKey = signedPreKeyToUpload,
|
||||
oneTimeEcPreKeys = oneTimeEcPreKeysToUpload,
|
||||
lastResortKyberPreKey = lastResortKyberPreKeyToUpload,
|
||||
|
|
|
@ -79,7 +79,7 @@ public class PniAccountInitializationMigrationJob extends MigrationJob {
|
|||
SignedPreKeyRecord signedPreKey = PreKeyUtil.generateAndStoreSignedPreKey(protocolStore, metadataStore);
|
||||
List<PreKeyRecord> oneTimePreKeys = PreKeyUtil.generateAndStoreOneTimeEcPreKeys(protocolStore, metadataStore);
|
||||
|
||||
accountManager.setPreKeys(new PreKeyUpload(ServiceIdType.PNI, protocolStore.getIdentityKeyPair().getPublicKey(), signedPreKey, oneTimePreKeys, null, null));
|
||||
accountManager.setPreKeys(new PreKeyUpload(ServiceIdType.PNI, signedPreKey, oneTimePreKeys, null, null));
|
||||
metadataStore.setActiveSignedPreKeyId(signedPreKey.getId());
|
||||
metadataStore.setSignedPreKeyRegistered(true);
|
||||
} else {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
package org.whispersystems.signalservice.api.account
|
||||
|
||||
import org.signal.libsignal.protocol.IdentityKey
|
||||
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
||||
import org.signal.libsignal.protocol.state.PreKeyRecord
|
||||
import org.signal.libsignal.protocol.state.SignedPreKeyRecord
|
||||
|
@ -18,7 +17,6 @@ import org.whispersystems.signalservice.api.push.ServiceIdType
|
|||
*/
|
||||
data class PreKeyUpload(
|
||||
val serviceIdType: ServiceIdType,
|
||||
val identityKey: IdentityKey,
|
||||
val signedPreKey: SignedPreKeyRecord?,
|
||||
val oneTimeEcPreKeys: List<PreKeyRecord>?,
|
||||
val lastResortKyberPreKey: KyberPreKeyRecord?,
|
||||
|
|
|
@ -12,11 +12,6 @@ import java.util.List;
|
|||
|
||||
public class PreKeyState {
|
||||
|
||||
@JsonProperty("identityKey")
|
||||
@JsonSerialize(using = JsonUtil.IdentityKeySerializer.class)
|
||||
@JsonDeserialize(using = JsonUtil.IdentityKeyDeserializer.class)
|
||||
private IdentityKey identityKey;
|
||||
|
||||
@JsonProperty("preKeys")
|
||||
private List<PreKeyEntity> oneTimeEcPreKeys;
|
||||
|
||||
|
@ -32,23 +27,17 @@ public class PreKeyState {
|
|||
public PreKeyState() {}
|
||||
|
||||
public PreKeyState(
|
||||
IdentityKey identityKey,
|
||||
SignedPreKeyEntity signedPreKey,
|
||||
List<PreKeyEntity> oneTimeEcPreKeys,
|
||||
KyberPreKeyEntity lastResortKyberPreKey,
|
||||
List<KyberPreKeyEntity> oneTimeKyberPreKeys
|
||||
) {
|
||||
this.identityKey = identityKey;
|
||||
this.signedPreKey = signedPreKey;
|
||||
this.oneTimeEcPreKeys = oneTimeEcPreKeys;
|
||||
this.lastResortKyberKey = lastResortKyberPreKey;
|
||||
this.oneTimeKyberKeys = oneTimeKyberPreKeys;
|
||||
}
|
||||
|
||||
public IdentityKey getIdentityKey() {
|
||||
return identityKey;
|
||||
}
|
||||
|
||||
public List<PreKeyEntity> getPreKeys() {
|
||||
return oneTimeEcPreKeys;
|
||||
}
|
||||
|
|
|
@ -745,8 +745,7 @@ public class PushServiceSocket {
|
|||
|
||||
makeServiceRequest(String.format(Locale.US, PREKEY_PATH, preKeyUpload.getServiceIdType().queryParam()),
|
||||
"PUT",
|
||||
JsonUtil.toJson(new PreKeyState(preKeyUpload.getIdentityKey(),
|
||||
signedPreKey,
|
||||
JsonUtil.toJson(new PreKeyState(signedPreKey,
|
||||
oneTimeEcPreKeys,
|
||||
lastResortKyberPreKey,
|
||||
oneTimeKyberPreKeys)));
|
||||
|
|
Loading…
Add table
Reference in a new issue