From cafa52c466e5e7831236e7d17b730edc84b864cc Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 25 Aug 2021 22:40:51 -0600 Subject: [PATCH] Special case redaction event sending from widgets per MSC2762 Fixes https://github.com/vector-im/element-web/issues/18573 See https://github.com/matrix-org/matrix-doc/pull/2762/commits/853bed215743f3e04af8683ea5e1ea2b47b7845b --- src/stores/widgets/StopGapWidgetDriver.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts index 13cd260ef0..57cf27764c 100644 --- a/src/stores/widgets/StopGapWidgetDriver.ts +++ b/src/stores/widgets/StopGapWidgetDriver.ts @@ -129,6 +129,9 @@ export class StopGapWidgetDriver extends WidgetDriver { if (stateKey !== null) { // state event r = await client.sendStateEvent(roomId, eventType, content, stateKey); + } else if (eventType === EventType.RoomRedaction) { + // special case: extract the `redacts` property and call redact + r = await client.redactEvent(roomId, content['redacts']); } else { // message event r = await client.sendEvent(roomId, eventType, content);