summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-09-10 10:32:05 +0100
committerDavid Baker <dbkr@matrix.org>2014-09-10 10:32:05 +0100
commit6f256e6380e4cb278af5dd5ae57460f0da2b2cf1 (patch)
tree6adbeb2ac61b4ce907e409b90d9ae30a95d85b88 /webclient
parentMore rst formatting. (diff)
downloadsynapse-6f256e6380e4cb278af5dd5ae57460f0da2b2cf1.tar.xz
reject calls if there's already a call in progress
Diffstat (limited to 'webclient')
-rw-r--r--webclient/app-controller.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index f28da87ccc..f8a0d8d35c 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -131,6 +131,10 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
 
     $rootScope.$on(matrixPhoneService.INCOMING_CALL_EVENT, function(ngEvent, call) {
         console.trace("incoming call");
+        if ($rootScope.currentCall && $rootScope.currentCall.state != 'ended') {
+            console.trace("rejecting call because we're already in a call");
+            call.hangup();
+        }
         call.onError = $scope.onCallError;
         call.onHangup = $scope.onCallHangup;
         $rootScope.currentCall = call;