Start a call immediately after creating a room via the dial pad (#6529)
This commit is contained in:
parent
a07df5e9d8
commit
c9c8177f58
3 changed files with 8 additions and 1 deletions
|
@ -930,6 +930,8 @@ export default class CallHandler extends EventEmitter {
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
room_id: roomId,
|
room_id: roomId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await this.placeCall(roomId, PlaceCallType.Voice, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async startTransferToPhoneNumber(call: MatrixCall, destination: string, consultFirst: boolean) {
|
private async startTransferToPhoneNumber(call: MatrixCall, destination: string, consultFirst: boolean) {
|
||||||
|
|
|
@ -156,13 +156,14 @@ describe('CallHandler', () => {
|
||||||
DMRoomMap.setShared(null);
|
DMRoomMap.setShared(null);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.mxCallHandler = null;
|
window.mxCallHandler = null;
|
||||||
|
fakeCall = null;
|
||||||
MatrixClientPeg.unset();
|
MatrixClientPeg.unset();
|
||||||
|
|
||||||
document.body.removeChild(audioElement);
|
document.body.removeChild(audioElement);
|
||||||
SdkConfig.unset();
|
SdkConfig.unset();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should look up the correct user and open the room when a phone number is dialled', async () => {
|
it('should look up the correct user and start a call in the room when a phone number is dialled', async () => {
|
||||||
MatrixClientPeg.get().getThirdpartyUser = jest.fn().mockResolvedValue([{
|
MatrixClientPeg.get().getThirdpartyUser = jest.fn().mockResolvedValue([{
|
||||||
userid: '@user2:example.org',
|
userid: '@user2:example.org',
|
||||||
protocol: "im.vector.protocol.sip_native",
|
protocol: "im.vector.protocol.sip_native",
|
||||||
|
@ -179,6 +180,9 @@ describe('CallHandler', () => {
|
||||||
|
|
||||||
const viewRoomPayload = await untilDispatch('view_room');
|
const viewRoomPayload = await untilDispatch('view_room');
|
||||||
expect(viewRoomPayload.room_id).toEqual(MAPPED_ROOM_ID);
|
expect(viewRoomPayload.room_id).toEqual(MAPPED_ROOM_ID);
|
||||||
|
|
||||||
|
// Check that a call was started
|
||||||
|
expect(fakeCall.roomId).toEqual(MAPPED_ROOM_ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should move calls between rooms when remote asserted identity changes', async () => {
|
it('should move calls between rooms when remote asserted identity changes', async () => {
|
||||||
|
|
|
@ -78,6 +78,7 @@ export function createTestClient() {
|
||||||
},
|
},
|
||||||
mxcUrlToHttp: (mxc) => 'http://this.is.a.url/',
|
mxcUrlToHttp: (mxc) => 'http://this.is.a.url/',
|
||||||
setAccountData: jest.fn(),
|
setAccountData: jest.fn(),
|
||||||
|
setRoomAccountData: jest.fn(),
|
||||||
sendTyping: jest.fn().mockResolvedValue({}),
|
sendTyping: jest.fn().mockResolvedValue({}),
|
||||||
sendMessage: () => jest.fn().mockResolvedValue({}),
|
sendMessage: () => jest.fn().mockResolvedValue({}),
|
||||||
getSyncState: () => "SYNCING",
|
getSyncState: () => "SYNCING",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue