Include and process destinationPniIdentityKey
This commit is contained in:
parent
711e321d16
commit
e031d136a1
11 changed files with 238 additions and 214 deletions
|
@ -136,6 +136,11 @@ export type SessionTransactionOptions = Readonly<{
|
|||
zone?: Zone;
|
||||
}>;
|
||||
|
||||
export type SaveIdentityOptions = Readonly<{
|
||||
zone?: Zone;
|
||||
noOverwrite?: boolean;
|
||||
}>;
|
||||
|
||||
export type VerifyAlternateIdentityOptionsType = Readonly<{
|
||||
aci: AciString;
|
||||
pni: PniString;
|
||||
|
@ -2049,7 +2054,7 @@ export class SignalProtocolStore extends EventEmitter {
|
|||
encodedAddress: Address,
|
||||
publicKey: Uint8Array,
|
||||
nonblockingApproval = false,
|
||||
{ zone = GLOBAL_ZONE }: SessionTransactionOptions = {}
|
||||
{ zone = GLOBAL_ZONE, noOverwrite = false }: SaveIdentityOptions = {}
|
||||
): Promise<boolean> {
|
||||
if (!this.identityKeys) {
|
||||
throw new Error('saveIdentity: this.identityKeys not yet cached!');
|
||||
|
@ -2100,6 +2105,10 @@ export class SignalProtocolStore extends EventEmitter {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (noOverwrite) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const identityKeyChanged = !constantTimeEqual(
|
||||
identityRecord.publicKey,
|
||||
publicKey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue