Upgrade to libsignal-client v0.19.2

This commit is contained in:
Scott Nonnenberg 2022-08-01 18:31:24 -07:00 committed by GitHub
parent e8c6f68e3f
commit 2b648b79a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 34 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,34 +1978,35 @@ export class SignalProtocolStore extends EventsMixin {
]);
}
async updateOurPniKeyMaterial(pni: UUID): /* {
identityKeyPair: identityBytes,
signedPreKey: signedPreKeyBytes,
registrationId,
}: PniKeyMaterialType
*/
Promise<void> {
throw new Error(
`TODO: SignalProtocolStore.updateOurPniKeyMaterial(${pni}) is not implemented!`
);
/*
async updateOurPniKeyMaterial(
pni: UUID,
{
identityKeyPair: identityBytes,
signedPreKey: signedPreKeyBytes,
registrationId,
}: PniKeyMaterialType
): Promise<void> {
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', {
@ -2030,7 +2031,6 @@ export class SignalProtocolStore extends EventsMixin {
signedPreKey.timestamp()
),
]);
*/
}
async removeAllData(): Promise<void> {