Move back to libsignal-client v0.18.1

This commit is contained in:
Scott Nonnenberg 2022-07-29 09:17:59 -07:00 committed by GitHub
parent d25e3c37ed
commit 08b2aeb237
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 26 deletions

View file

@ -7,7 +7,7 @@ import { z } from 'zod';
import {
Direction,
IdentityKeyPair,
// IdentityKeyPair,
PreKeyRecord,
PrivateKey,
PublicKey,
@ -32,7 +32,7 @@ import type {
IdentityKeyIdType,
KeyPairType,
OuterSignedPrekeyType,
PniKeyMaterialType,
// PniKeyMaterialType,
PreKeyIdType,
PreKeyType,
SenderKeyIdType,
@ -1978,35 +1978,34 @@ export class SignalProtocolStore extends EventsMixin {
]);
}
async updateOurPniKeyMaterial(
pni: UUID,
{
identityKeyPair: identityBytes,
signedPreKey: signedPreKeyBytes,
registrationId,
}: PniKeyMaterialType
): Promise<void> {
log.info(`SignalProtocolStore.updateOurPniKeyMaterial(${pni})`);
async updateOurPniKeyMaterial(pni: UUID): /* {
identityKeyPair: identityBytes,
signedPreKey: signedPreKeyBytes,
registrationId,
}: PniKeyMaterialType
*/
Promise<void> {
throw new Error(
`TODO: SignalProtocolStore.updateOurPniKeyMaterial(${pni}) is not implemented!`
);
/*
log.info(`SignalProtocolStore.updateOurPniKeyMaterial(${pni})`);
const identityKeyPair = IdentityKeyPair.deserialize(
Buffer.from(identityBytes)
);
const signedPreKey = SignedPreKeyRecord.deserialize(
Buffer.from(signedPreKeyBytes)
);
const { storage } = window;
const pniPublicKey = identityKeyPair.publicKey.serialize();
const pniPrivateKey = identityKeyPair.privateKey.serialize();
// Update caches
this.ourIdentityKeys.set(pni.toString(), {
pubKey: pniPublicKey,
privKey: pniPrivateKey,
});
this.ourRegistrationIds.set(pni.toString(), registrationId);
// Update database
await Promise.all([
storage.put('identityKeyMap', {
@ -2031,6 +2030,7 @@ export class SignalProtocolStore extends EventsMixin {
signedPreKey.timestamp()
),
]);
*/
}
async removeAllData(): Promise<void> {