Actually enforce 1 call semantics.

This commit is contained in:
Kegan Dougal 2015-09-15 11:43:51 +01:00
parent 59986d8b72
commit 5e3698de64
1 changed files with 6 additions and 2 deletions

View File

@ -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.
}