Skip to content

Commit 53f2ad4

Browse files
authored
Deprecate non-functional IJoinRoomOpts.syncRoom (#4913)
I don't know when this last did something, but it's been a while.
1 parent be15a70 commit 53f2ad4

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/@types/requests.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ import { type EventType, type RelationType, type RoomType } from "./event.ts";
2828

2929
export interface IJoinRoomOpts {
3030
/**
31-
* True to do a room initial sync on the resulting
32-
* room. If false, the <strong>returned Room object will have no current state.
33-
* </strong> Default: true.
31+
* @deprecated does nothing
3432
*/
3533
syncRoom?: boolean;
3634

src/client.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,10 +2369,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
23692369
* @returns Rejects: with an error response.
23702370
*/
23712371
public async joinRoom(roomIdOrAlias: string, opts: IJoinRoomOpts = {}): Promise<Room> {
2372-
if (opts.syncRoom === undefined) {
2373-
opts.syncRoom = true;
2374-
}
2375-
23762372
const room = this.getRoom(roomIdOrAlias);
23772373
if (room?.hasMembershipState(this.credentials.userId!, KnownMembership.Join)) return room;
23782374

@@ -2408,12 +2404,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
24082404
if (resolvedRoom?.hasMembershipState(this.credentials.userId!, KnownMembership.Join)) return resolvedRoom;
24092405

24102406
const syncApi = new SyncApi(this, this.clientOpts, this.buildSyncApiOptions());
2411-
const syncRoom = syncApi.createRoom(roomId);
2412-
if (opts.syncRoom) {
2413-
// v2 will do this for us
2414-
// return syncApi.syncRoom(room);
2415-
}
2416-
return syncRoom;
2407+
return syncApi.createRoom(roomId);
24172408
}
24182409

24192410
/**

0 commit comments

Comments
 (0)