mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-23 05:07:03 +00:00
Hangup when last person in call (based on url params) (#3372)
* Introduce condigurable auto leave option * Read url params for auto leave * add tests * rename url param to `autoLeave` * lint Signed-off-by: Timo K <toger5@hotmail.de> * fix scope in CallViewModel tests Signed-off-by: Timo K <toger5@hotmail.de> * use auto leave in DM case Signed-off-by: Timo K <toger5@hotmail.de> * Make last once leave logic based on matrix user id (was participant id before) Signed-off-by: Timo K <toger5@hotmail.de> * add test for multi device auto leave Signed-off-by: Timo K <toger5@hotmail.de> --------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -12,7 +12,11 @@ import {
|
||||
mockLocalParticipant,
|
||||
} from "./test";
|
||||
|
||||
export const localRtcMember = mockRtcMembership("@carol:example.org", "CCCC");
|
||||
export const localRtcMember = mockRtcMembership("@carol:example.org", "1111");
|
||||
export const localRtcMemberDevice2 = mockRtcMembership(
|
||||
"@carol:example.org",
|
||||
"2222",
|
||||
);
|
||||
export const local = mockMatrixRoomMember(localRtcMember);
|
||||
export const localParticipant = mockLocalParticipant({ identity: "" });
|
||||
export const localId = `${local.userId}:${localRtcMember.deviceId}`;
|
||||
|
||||
@@ -139,7 +139,7 @@ export function getBasicCallViewModelEnvironment(
|
||||
liveKitRoom,
|
||||
mockMediaDevices({}),
|
||||
{
|
||||
kind: E2eeType.PER_PARTICIPANT,
|
||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||
},
|
||||
of(ConnectionState.Connected),
|
||||
handRaisedSubject$,
|
||||
|
||||
@@ -74,6 +74,7 @@ export interface OurRunHelpers extends RunHelpers {
|
||||
values?: { [marble: string]: T },
|
||||
error?: unknown,
|
||||
): Behavior<T>;
|
||||
scope: ObservableScope;
|
||||
}
|
||||
|
||||
interface TestRunnerGlobal {
|
||||
@@ -96,6 +97,7 @@ export function withTestScheduler(
|
||||
scheduler.run((helpers) =>
|
||||
continuation({
|
||||
...helpers,
|
||||
scope,
|
||||
schedule(marbles, actions) {
|
||||
const actionsObservable$ = helpers
|
||||
.cold(marbles)
|
||||
|
||||
Reference in New Issue
Block a user