From 9495ba001c95f6b330c582f7b001358d64f31f8f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 13 Jul 2021 23:17:17 -0600 Subject: [PATCH] Send clear events to widgets when permitted Fixes https://github.com/vector-im/element-web/issues/17615 --- src/stores/widgets/StopGapWidget.ts | 2 +- src/stores/widgets/StopGapWidgetDriver.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index 36791d3dd9..7120647078 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -415,7 +415,7 @@ export class StopGapWidget extends EventEmitter { private feedEvent(ev: MatrixEvent) { if (!this.messaging) return; - const raw = ev.event as IEvent; + const raw = ev.getClearEvent() as IEvent; this.messaging.feedEvent(raw).catch(e => { console.error("Error sending event to widget: ", e); }); diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts index fd064bae61..5de8a0a361 100644 --- a/src/stores/widgets/StopGapWidgetDriver.ts +++ b/src/stores/widgets/StopGapWidgetDriver.ts @@ -164,7 +164,7 @@ export class StopGapWidgetDriver extends WidgetDriver { results.push(ev); } - return results.map(e => e.event); + return results.map(e => e.getClearEvent()); } public async readStateEvents(eventType: string, stateKey: string | undefined, limit: number): Promise {