dont store duplicated key values for replay detection

This commit is contained in:
Bruno Windels 2020-09-11 12:08:06 +02:00
parent 0dece5b04f
commit bba53b3477
2 changed files with 3 additions and 6 deletions

View File

@ -66,10 +66,7 @@ export class DecryptionChanges {
}
if (!decryption) {
txn.groupSessionDecryptions.set({
roomId,
sessionId,
messageIndex,
txn.groupSessionDecryptions.set(roomId, sessionId, messageIndex, {
eventId,
timestamp
});

View File

@ -27,8 +27,8 @@ export class GroupSessionDecryptionStore {
return this._store.get(encodeKey(roomId, sessionId, messageIndex));
}
set(decryption) {
decryption.key = encodeKey(decryption.roomId, decryption.sessionId, decryption.messageIndex);
set(roomId, sessionId, messageIndex, decryption) {
decryption.key = encodeKey(roomId, sessionId, messageIndex);
this._store.put(decryption);
}
}