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

Commit

Permalink
Only return the approved widget capabilities instead of accepting all…
Browse files Browse the repository at this point in the history
… requested capabilities
  • Loading branch information
dhenneke committed Jan 3, 2022
1 parent 03f5a3c commit 0ff567d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/stores/widgets/StopGapWidgetDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { IContent, IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { logger } from "matrix-js-sdk/src/logger";

import { iterableDiff, iterableUnion } from "../../utils/iterables";
import { iterableDiff } from "../../utils/iterables";
import { MatrixClientPeg } from "../../MatrixClientPeg";
import ActiveRoomObserver from "../../ActiveRoomObserver";
import Modal from "../../Modal";
Expand Down Expand Up @@ -131,13 +131,11 @@ export class StopGapWidgetDriver extends WidgetDriver {
}
}

const allAllowed = new Set(iterableUnion(allowedSoFar, requested));

if (rememberApproved) {
setRememberedCapabilitiesForWidget(this.forWidget, Array.from(allAllowed));
setRememberedCapabilitiesForWidget(this.forWidget, Array.from(allowedSoFar));
}

return allAllowed;
return allowedSoFar;
}

public async sendEvent(
Expand Down

0 comments on commit 0ff567d

Please sign in to comment.