From 44ac00272c50706ccbc8d994810d814d4ac4db0e Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 26 Jan 2022 12:58:23 +0000 Subject: [PATCH] Revert "Start a conference in a room with 2 people + invitee rather than a 1:1 call (#7557)" This reverts commit 8ced6e6117b734a154db7f64b1a63c4f07bf56b1. --- src/CallHandler.tsx | 7 +++---- test/CallHandler-test.ts | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 76e9d50d69b..4cf6561fc29 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -822,13 +822,12 @@ export default class CallHandler extends EventEmitter { // We leave the check for whether there's already a call in this room until later, // otherwise it can race. - const joinedMemberCount = room.getJoinedMemberCount(); - const invitedAndJoinedMemberCount = room.getInvitedAndJoinedMemberCount(); - if (joinedMemberCount <= 1) { + const members = room.getJoinedMembers(); + if (members.length <= 1) { Modal.createTrackedDialog('Call Handler', 'Cannot place call with self', ErrorDialog, { description: _t('You cannot place a call with yourself.'), }); - } else if (invitedAndJoinedMemberCount === 2) { + } else if (members.length === 2) { logger.info(`Place ${type} call in ${roomId}`); this.placeMatrixCall(roomId, type, transferee); diff --git a/test/CallHandler-test.ts b/test/CallHandler-test.ts index e9515e0db5a..6aaf8cbe1bf 100644 --- a/test/CallHandler-test.ts +++ b/test/CallHandler-test.ts @@ -54,8 +54,6 @@ function mkStubDM(roomId, userId) { getMxcAvatarUrl: () => 'mxc://avatar.url/image.png', }, ]); - room.getJoinedMemberCount = jest.fn().mockReturnValue(room.getJoinedMembers().length); - room.getInvitedAndJoinedMemberCount = jest.fn().mockReturnValue(room.getJoinedMembers().length); room.currentState.getMembers = room.getJoinedMembers; return room;