UUID-keyed lookups in SignalProtocolStore

This commit is contained in:
Fedor Indutny 2021-09-09 19:38:11 -07:00 committed by GitHub
parent 6323aedd9b
commit c7e7d55af4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 2094 additions and 1447 deletions

View file

@ -15,6 +15,8 @@ import { isGroupV2 } from './whatTypeOfConversation';
import { isOlderThan } from './timestamp';
import { parseIntOrThrow } from './parseIntOrThrow';
import * as RemoteConfig from '../RemoteConfig';
import { Address } from '../types/Address';
import { QualifiedAddress } from '../types/QualifiedAddress';
import { ConversationModel } from '../models/conversations';
import {
@ -184,7 +186,11 @@ async function archiveSessionOnMatch({
return;
}
const address = `${requesterUuid}.${requesterDevice}`;
const ourUuid = window.textsecure.storage.user.getCheckedUuid();
const address = new QualifiedAddress(
ourUuid,
Address.create(requesterUuid, requesterDevice)
);
const session = await window.textsecure.storage.protocol.loadSession(address);
if (session && session.currentRatchetKeyMatches(ratchetKey)) {
@ -500,9 +506,10 @@ function scheduleSessionReset(senderUuid: string, senderDevice: number) {
}
lightSessionResetQueue.add(() => {
const ourUuid = window.textsecure.storage.user.getCheckedUuid();
window.textsecure.storage.protocol.lightSessionReset(
senderUuid,
senderDevice
new QualifiedAddress(ourUuid, Address.create(senderUuid, senderDevice))
);
});
}