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

Commit b3202de

Browse files
authored
Only return the approved widget capabilities instead of accepting all requested capabilities (#7454)
* Only return the approved widget capabilities instead of accepting all requested capabilities * Restore the original logic that only keeps accepted permissions if they were requested Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
1 parent dc2d52c commit b3202de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/stores/widgets/StopGapWidgetDriver.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { IContent, IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event";
3434
import { Room } from "matrix-js-sdk/src/models/room";
3535
import { logger } from "matrix-js-sdk/src/logger";
3636

37-
import { iterableDiff, iterableUnion } from "../../utils/iterables";
37+
import { iterableDiff, iterableIntersection } from "../../utils/iterables";
3838
import { MatrixClientPeg } from "../../MatrixClientPeg";
3939
import ActiveRoomObserver from "../../ActiveRoomObserver";
4040
import Modal from "../../Modal";
@@ -131,7 +131,9 @@ export class StopGapWidgetDriver extends WidgetDriver {
131131
}
132132
}
133133

134-
const allAllowed = new Set(iterableUnion(allowedSoFar, requested));
134+
// discard all previously allowed capabilities if they are not requested
135+
// TODO: this results in an unexpected behavior when this function is called during the capabilities renegotiation of MSC2974 that will be resolved later.
136+
const allAllowed = new Set(iterableIntersection(allowedSoFar, requested));
135137

136138
if (rememberApproved) {
137139
setRememberedCapabilitiesForWidget(this.forWidget, Array.from(allAllowed));

0 commit comments

Comments
 (0)