You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-17 21:42:17 +03:00
Deprecate non-functional IJoinRoomOpts.syncRoom (#4913)
I don't know when this last did something, but it's been a while.
This commit is contained in:
committed by
GitHub
parent
be15a709c6
commit
53f2ad41d6
@@ -28,9 +28,7 @@ import { type EventType, type RelationType, type RoomType } from "./event.ts";
|
|||||||
|
|
||||||
export interface IJoinRoomOpts {
|
export interface IJoinRoomOpts {
|
||||||
/**
|
/**
|
||||||
* True to do a room initial sync on the resulting
|
* @deprecated does nothing
|
||||||
* room. If false, the <strong>returned Room object will have no current state.
|
|
||||||
* </strong> Default: true.
|
|
||||||
*/
|
*/
|
||||||
syncRoom?: boolean;
|
syncRoom?: boolean;
|
||||||
|
|
||||||
|
|||||||
@@ -2369,10 +2369,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
* @returns Rejects: with an error response.
|
* @returns Rejects: with an error response.
|
||||||
*/
|
*/
|
||||||
public async joinRoom(roomIdOrAlias: string, opts: IJoinRoomOpts = {}): Promise<Room> {
|
public async joinRoom(roomIdOrAlias: string, opts: IJoinRoomOpts = {}): Promise<Room> {
|
||||||
if (opts.syncRoom === undefined) {
|
|
||||||
opts.syncRoom = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const room = this.getRoom(roomIdOrAlias);
|
const room = this.getRoom(roomIdOrAlias);
|
||||||
if (room?.hasMembershipState(this.credentials.userId!, KnownMembership.Join)) return room;
|
if (room?.hasMembershipState(this.credentials.userId!, KnownMembership.Join)) return room;
|
||||||
|
|
||||||
@@ -2408,12 +2404,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
if (resolvedRoom?.hasMembershipState(this.credentials.userId!, KnownMembership.Join)) return resolvedRoom;
|
if (resolvedRoom?.hasMembershipState(this.credentials.userId!, KnownMembership.Join)) return resolvedRoom;
|
||||||
|
|
||||||
const syncApi = new SyncApi(this, this.clientOpts, this.buildSyncApiOptions());
|
const syncApi = new SyncApi(this, this.clientOpts, this.buildSyncApiOptions());
|
||||||
const syncRoom = syncApi.createRoom(roomId);
|
return syncApi.createRoom(roomId);
|
||||||
if (opts.syncRoom) {
|
|
||||||
// v2 will do this for us
|
|
||||||
// return syncApi.syncRoom(room);
|
|
||||||
}
|
|
||||||
return syncRoom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user