From 9be64730b6ecfd34bc62454e4c3e53f21d18e676 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Mon, 11 Apr 2022 15:54:06 +0200 Subject: [PATCH] don't automatically join a call we create --- src/domain/session/room/RoomViewModel.js | 3 ++- src/matrix/calls/CallHandler.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index 6dd8c8bd..87b4aa9d 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -359,7 +359,8 @@ export class RoomViewModel extends ViewModel { const mediaTracks = await this.platform.mediaDevices.getMediaTracks(false, true); const localMedia = new LocalMedia().withTracks(mediaTracks); // this will set the callViewModel above as a call will be added to callHandler.calls - await session.callHandler.createCall(this._room.id, localMedia, "A call " + Math.round(this.platform.random() * 100)); + const call = await session.callHandler.createCall(this._room.id, localMedia, "A call " + Math.round(this.platform.random() * 100)); + await call.join(localMedia); } catch (err) { console.error(err.stack); alert(err.message); diff --git a/src/matrix/calls/CallHandler.ts b/src/matrix/calls/CallHandler.ts index d658121e..31829396 100644 --- a/src/matrix/calls/CallHandler.ts +++ b/src/matrix/calls/CallHandler.ts @@ -117,7 +117,6 @@ export class CallHandler { try { await call.create(localMedia); - await call.join(localMedia); // store call info so it will ring again when reopening the app const txn = await this.options.storage.readWriteTxn([this.options.storage.storeNames.calls]); txn.calls.add({