filter encrypted events before deciding to decrypt or not
This commit is contained in:
parent
9702c4fd64
commit
3bfe52b1dc
1 changed files with 4 additions and 5 deletions
|
@ -183,11 +183,10 @@ export class Room extends EventEmitter {
|
|||
events = events.concat(retryEntries.map(entry => entry.event));
|
||||
}
|
||||
}
|
||||
|
||||
if (events.length) {
|
||||
const eventsToDecrypt = events.filter(event => {
|
||||
return event?.type === EVENT_ENCRYPTED_TYPE;
|
||||
});
|
||||
const eventsToDecrypt = events.filter(event => {
|
||||
return event?.type === EVENT_ENCRYPTED_TYPE;
|
||||
});
|
||||
if (eventsToDecrypt.length) {
|
||||
decryptPreparation = await roomEncryption.prepareDecryptAll(
|
||||
eventsToDecrypt, newKeys, DecryptionSource.Sync, txn);
|
||||
}
|
||||
|
|
Reference in a new issue