mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-07 05:47:03 +00:00
Tentatively rename URL parameter to waitForCallPickup
This commit is contained in:
@@ -226,7 +226,7 @@ export interface UrlConfiguration {
|
||||
* - play a sound that indicates that it is awaiting an answer
|
||||
* - auto-dismiss the call widget once the notification lifetime expires on the receivers side.
|
||||
*/
|
||||
shouldWaitForCallPickup: boolean;
|
||||
waitForCallPickup: boolean;
|
||||
}
|
||||
|
||||
// If you need to add a new flag to this interface, prefer a name that describes
|
||||
@@ -358,7 +358,7 @@ export const getUrlParams = (
|
||||
returnToLobby: false,
|
||||
sendNotificationType: "notification" as RTCNotificationType,
|
||||
autoLeaveWhenOthersLeft: false,
|
||||
shouldWaitForCallPickup: false,
|
||||
waitForCallPickup: false,
|
||||
};
|
||||
switch (intent) {
|
||||
case UserIntent.StartNewCall:
|
||||
@@ -378,7 +378,7 @@ export const getUrlParams = (
|
||||
...inAppDefault,
|
||||
skipLobby: true,
|
||||
autoLeaveWhenOthersLeft: true,
|
||||
shouldWaitForCallPickup: true,
|
||||
waitForCallPickup: true,
|
||||
};
|
||||
break;
|
||||
case UserIntent.JoinExistingCallDM:
|
||||
@@ -404,7 +404,7 @@ export const getUrlParams = (
|
||||
returnToLobby: false,
|
||||
sendNotificationType: undefined,
|
||||
autoLeaveWhenOthersLeft: false,
|
||||
shouldWaitForCallPickup: false,
|
||||
waitForCallPickup: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ export const getUrlParams = (
|
||||
"ring",
|
||||
"notification",
|
||||
]),
|
||||
shouldWaitForCallPickup: parser.getFlag("shouldWaitForCallPickup"),
|
||||
waitForCallPickup: parser.getFlag("waitForCallPickup"),
|
||||
autoLeaveWhenOthersLeft: parser.getFlag("autoLeave"),
|
||||
};
|
||||
|
||||
|
||||
@@ -1193,7 +1193,7 @@ test("autoLeave$ emits when autoLeaveWhenOthersLeft option is enabled and all ot
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldWaitForCallPickup$", () => {
|
||||
describe("waitForCallPickup$", () => {
|
||||
test("unknown -> ringing -> timeout when notified and nobody joins", () => {
|
||||
withTestScheduler(({ schedule, expectObservable }) => {
|
||||
// No one ever joins (only local user)
|
||||
@@ -1220,7 +1220,7 @@ describe("shouldWaitForCallPickup$", () => {
|
||||
});
|
||||
},
|
||||
{
|
||||
shouldWaitForCallPickup: true,
|
||||
waitForCallPickup: true,
|
||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||
},
|
||||
);
|
||||
@@ -1264,7 +1264,7 @@ describe("shouldWaitForCallPickup$", () => {
|
||||
});
|
||||
},
|
||||
{
|
||||
shouldWaitForCallPickup: true,
|
||||
waitForCallPickup: true,
|
||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||
},
|
||||
);
|
||||
@@ -1305,7 +1305,7 @@ describe("shouldWaitForCallPickup$", () => {
|
||||
});
|
||||
},
|
||||
{
|
||||
shouldWaitForCallPickup: true,
|
||||
waitForCallPickup: true,
|
||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||
},
|
||||
);
|
||||
@@ -1336,14 +1336,14 @@ describe("shouldWaitForCallPickup$", () => {
|
||||
});
|
||||
},
|
||||
{
|
||||
shouldWaitForCallPickup: true,
|
||||
waitForCallPickup: true,
|
||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("stays null when shouldWaitForCallPickup=false", () => {
|
||||
test("stays null when waitForCallPickup=false", () => {
|
||||
withTestScheduler(({ behavior, schedule, expectObservable }) => {
|
||||
withCallViewModel(
|
||||
{
|
||||
@@ -1375,7 +1375,7 @@ describe("shouldWaitForCallPickup$", () => {
|
||||
});
|
||||
},
|
||||
{
|
||||
shouldWaitForCallPickup: false,
|
||||
waitForCallPickup: false,
|
||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||
},
|
||||
);
|
||||
|
||||
@@ -120,7 +120,7 @@ export interface CallViewModelOptions {
|
||||
* If the call is started in a way where we want it to behave like a telephone usecase
|
||||
* If we sent a notification event, we want the ui to show a ringing state
|
||||
*/
|
||||
shouldWaitForCallPickup?: boolean;
|
||||
waitForCallPickup?: boolean;
|
||||
}
|
||||
|
||||
// How long we wait after a focus switch before showing the real participant
|
||||
@@ -916,7 +916,7 @@ export class CallViewModel extends ViewModel {
|
||||
* - "success": Someone else joined. The call is in a normal state. No audiovisual feedback.
|
||||
* - null: EC is configured to never show any waiting for answer state.
|
||||
*/
|
||||
public readonly callPickupState$ = this.options.shouldWaitForCallPickup
|
||||
public readonly callPickupState$ = this.options.waitForCallPickup
|
||||
? this.scope.behavior<"unknown" | "ringing" | "timeout" | "success">(
|
||||
concat(
|
||||
concat(
|
||||
|
||||
Reference in New Issue
Block a user