Replace MSC3244 support with in-client room version checking (#9018)
* Replace MSC3244 support with in-client room version checking * Fix irrelevant ternary * It helps to use Jest correctly
This commit is contained in:
parent
bd8949872d
commit
644b841591
7 changed files with 120 additions and 37 deletions
|
@ -18,7 +18,7 @@ import { ListIteratee, Many, sortBy } from "lodash";
|
|||
import { EventType, RoomType } from "matrix-js-sdk/src/@types/event";
|
||||
import { Room, RoomEvent } from "matrix-js-sdk/src/models/room";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { ClientEvent, IRoomCapability } from "matrix-js-sdk/src/client";
|
||||
import { ClientEvent } from "matrix-js-sdk/src/client";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
|
||||
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
|
||||
|
@ -132,7 +132,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
private _suggestedRooms: ISuggestedRoom[] = [];
|
||||
private _invitedSpaces = new Set<Room>();
|
||||
private spaceOrderLocalEchoMap = new Map<string, string>();
|
||||
private _restrictedJoinRuleSupport?: IRoomCapability;
|
||||
// The following properties are set by onReady as they live in account_data
|
||||
private _allRoomsInHome = false;
|
||||
private _enabledMetaSpaces: MetaSpace[] = [];
|
||||
|
@ -210,10 +209,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
}
|
||||
}
|
||||
|
||||
public get restrictedJoinRuleSupport(): IRoomCapability {
|
||||
return this._restrictedJoinRuleSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the active space, updates room list filters,
|
||||
* optionally switches the user's room back to where they were when they last viewed that space.
|
||||
|
@ -1066,11 +1061,6 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
this.matrixClient.on(RoomStateEvent.Members, this.onRoomStateMembers);
|
||||
this.matrixClient.on(ClientEvent.AccountData, this.onAccountData);
|
||||
|
||||
this.matrixClient.getCapabilities().then(capabilities => {
|
||||
this._restrictedJoinRuleSupport = capabilities
|
||||
?.["m.room_versions"]?.["org.matrix.msc3244.room_capabilities"]?.["restricted"];
|
||||
});
|
||||
|
||||
const oldMetaSpaces = this._enabledMetaSpaces;
|
||||
const enabledMetaSpaces = SettingsStore.getValue("Spaces.enabledMetaSpaces");
|
||||
this._enabledMetaSpaces = metaSpaceOrder.filter(k => enabledMetaSpaces[k]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue