mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Actually enforce 1 call semantics.
This commit is contained in:
parent
59986d8b72
commit
5e3698de64
@ -154,7 +154,11 @@ function _setCallState(call, roomId, status) {
|
|||||||
dis.register(function(payload) {
|
dis.register(function(payload) {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'place_call':
|
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.
|
return; // don't allow >1 call to be placed.
|
||||||
}
|
}
|
||||||
var room = MatrixClientPeg.get().getRoom(payload.room_id);
|
var room = MatrixClientPeg.get().getRoom(payload.room_id);
|
||||||
@ -207,7 +211,7 @@ dis.register(function(payload) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'incoming_call':
|
case 'incoming_call':
|
||||||
if (calls[payload.call.roomId]) {
|
if (module.exports.getAnyActiveCall()) {
|
||||||
payload.call.hangup("busy");
|
payload.call.hangup("busy");
|
||||||
return; // don't allow >1 call to be received, hangup newer one.
|
return; // don't allow >1 call to be received, hangup newer one.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user