mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
filter encrypted events before deciding to decrypt or not
This commit is contained in:
parent
9702c4fd64
commit
3bfe52b1dc
@ -183,11 +183,10 @@ export class Room extends EventEmitter {
|
|||||||
events = events.concat(retryEntries.map(entry => entry.event));
|
events = events.concat(retryEntries.map(entry => entry.event));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (events.length) {
|
|
||||||
const eventsToDecrypt = events.filter(event => {
|
const eventsToDecrypt = events.filter(event => {
|
||||||
return event?.type === EVENT_ENCRYPTED_TYPE;
|
return event?.type === EVENT_ENCRYPTED_TYPE;
|
||||||
});
|
});
|
||||||
|
if (eventsToDecrypt.length) {
|
||||||
decryptPreparation = await roomEncryption.prepareDecryptAll(
|
decryptPreparation = await roomEncryption.prepareDecryptAll(
|
||||||
eventsToDecrypt, newKeys, DecryptionSource.Sync, txn);
|
eventsToDecrypt, newKeys, DecryptionSource.Sync, txn);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user