Simple refactor for skipLobby (#30848)

* Simple refactor for skipLobby (and remove returnToLobby)

* Tidyup

* Remove unused tests

* Add video room support.

* Add a test for video rooms

* tidy

* Document
This commit is contained in:
Will Hunt
2025-09-25 13:46:37 +01:00
committed by GitHub
parent 65eb4ce1d3
commit 75083c2e80
11 changed files with 184 additions and 164 deletions

View File

@@ -109,10 +109,6 @@ interface State {
* Whether we're viewing a call or call lobby in this room
*/
viewingCall: boolean;
/**
* If we want the call to skip the lobby and immediately join
*/
skipLobby?: boolean;
promptAskToJoin: boolean;
@@ -359,13 +355,13 @@ export class RoomViewStore extends EventEmitter {
let call = CallStore.instance.getCall(payload.room_id);
// Start a call if not already there
if (call === null) {
ElementCall.create(room, false);
ElementCall.create(room);
call = CallStore.instance.getCall(payload.room_id)!;
}
call.presented = true;
// Immediately start the call. This will connect to all required widget events
// and allow the widget to show the lobby.
if (call.connectionState === ConnectionState.Disconnected) call.start();
if (call.connectionState === ConnectionState.Disconnected) call.start({ skipLobby: payload.skipLobby });
}
// If we switch to a different room from the call, we are no longer presenting it
const prevRoomCall = this.state.roomId ? CallStore.instance.getCall(this.state.roomId) : null;
@@ -413,7 +409,6 @@ export class RoomViewStore extends EventEmitter {
replyingToEvent: null,
viaServers: payload.via_servers ?? [],
wasContextSwitch: payload.context_switch ?? false,
skipLobby: payload.skipLobby,
viewingCall:
payload.view_call ??
(payload.room_id === this.state.roomId
@@ -470,7 +465,6 @@ export class RoomViewStore extends EventEmitter {
viaServers: payload.via_servers,
wasContextSwitch: payload.context_switch,
viewingCall: payload.view_call ?? false,
skipLobby: payload.skipLobby,
});
try {
const result = await MatrixClientPeg.safeGet().getRoomIdForAlias(payload.room_alias);
@@ -739,10 +733,6 @@ export class RoomViewStore extends EventEmitter {
return this.state.viewingCall;
}
public skipCallLobby(): boolean | undefined {
return this.state.skipLobby;
}
/**
* Gets the current state of the 'promptForAskToJoin' property.
*