1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Re-insert room IDs when decrypting bundled redaction events returned by /sync (#2531)

This commit is contained in:
Faye Duxovni
2022-07-21 06:55:20 -04:00
committed by GitHub
parent 45db39ec88
commit 5367ee18fb
2 changed files with 70 additions and 2 deletions

View File

@@ -2859,7 +2859,10 @@ export class Crypto extends TypedEventEmitter<CryptoEvent, CryptoEventHandlerMap
*/
public async decryptEvent(event: MatrixEvent): Promise<IEventDecryptionResult> {
if (event.isRedacted()) {
const redactionEvent = new MatrixEvent(event.getUnsigned().redacted_because);
const redactionEvent = new MatrixEvent({
room_id: event.getRoomId(),
...event.getUnsigned().redacted_because,
});
const decryptedEvent = await this.decryptEvent(redactionEvent);
return {