From 5e3698de640ecb91b1c969bd3031e911dbdac43a Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 15 Sep 2015 11:43:51 +0100 Subject: [PATCH] Actually enforce 1 call semantics. --- src/CallHandler.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index 28fd77e7f..2cfd114f3 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -154,7 +154,11 @@ function _setCallState(call, roomId, status) { dis.register(function(payload) { switch (payload.action) { case 'place_call': - if (calls[payload.room_id]) { + if (module.exports.getAnyActiveCall()) { + Modal.createDialog(ErrorDialog, { + title: "Existing Call", + description: "You are already in a call." + }); return; // don't allow >1 call to be placed. } var room = MatrixClientPeg.get().getRoom(payload.room_id); @@ -207,7 +211,7 @@ dis.register(function(payload) { } break; case 'incoming_call': - if (calls[payload.call.roomId]) { + if (module.exports.getAnyActiveCall()) { payload.call.hangup("busy"); return; // don't allow >1 call to be received, hangup newer one. }