Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Send clear events to widgets when permitted #6371

Merged
merged 3 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/stores/widgets/StopGapWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import ThemeWatcher from "../../settings/watchers/ThemeWatcher";
import { getCustomTheme } from "../../theme";
import CountlyAnalytics from "../../CountlyAnalytics";
import { ElementWidgetCapabilities } from "./ElementWidgetCapabilities";
import { MatrixEvent, IEvent } from "matrix-js-sdk/src/models/event";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { ELEMENT_CLIENT_ID } from "../../identifiers";
import { getUserLanguage } from "../../languageHandler";

Expand Down Expand Up @@ -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.getEffectiveEvent();
this.messaging.feedEvent(raw).catch(e => {
console.error("Error sending event to widget: ", e);
});
Expand Down
2 changes: 1 addition & 1 deletion src/stores/widgets/StopGapWidgetDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
results.push(ev);
}

return results.map(e => e.event);
return results.map(e => e.getEffectiveEvent());
}

public async readStateEvents(eventType: string, stateKey: string | undefined, limit: number): Promise<object[]> {
Expand Down