Skip to content

Commit 5e3698d

Browse files
committed
Actually enforce 1 call semantics.
1 parent 59986d8 commit 5e3698d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/CallHandler.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ function _setCallState(call, roomId, status) {
154154
dis.register(function(payload) {
155155
switch (payload.action) {
156156
case 'place_call':
157-
if (calls[payload.room_id]) {
157+
if (module.exports.getAnyActiveCall()) {
158+
Modal.createDialog(ErrorDialog, {
159+
title: "Existing Call",
160+
description: "You are already in a call."
161+
});
158162
return; // don't allow >1 call to be placed.
159163
}
160164
var room = MatrixClientPeg.get().getRoom(payload.room_id);
@@ -207,7 +211,7 @@ dis.register(function(payload) {
207211
}
208212
break;
209213
case 'incoming_call':
210-
if (calls[payload.call.roomId]) {
214+
if (module.exports.getAnyActiveCall()) {
211215
payload.call.hangup("busy");
212216
return; // don't allow >1 call to be received, hangup newer one.
213217
}

0 commit comments

Comments
 (0)