From f90ce04a8318d00df9db70e1b4cae500785a7d44 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 9 Sep 2014 18:21:03 +0100 Subject: [PATCH] Hangup call if user denies media access. --- webclient/app-controller.js | 8 -------- webclient/components/matrix/matrix-call.js | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/webclient/app-controller.js b/webclient/app-controller.js index 4a57f66ef..f28da87cc 100644 --- a/webclient/app-controller.js +++ b/webclient/app-controller.js @@ -142,14 +142,6 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even $scope.hangupCall = function() { $rootScope.currentCall.hangup(); - - $timeout(function() { - var icon = angular.element('#callEndedIcon'); - $animate.addClass(icon, 'callIconRotate'); - $timeout(function(){ - $rootScope.currentCall = undefined; - }, 4070); - }, 100); }; $rootScope.onCallError = function(errStr) { diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js index 16f22fe36..feb113f60 100644 --- a/webclient/components/matrix/matrix-call.js +++ b/webclient/components/matrix/matrix-call.js @@ -114,6 +114,7 @@ angular.module('MatrixCall', []) }; matrixService.sendEvent(this.room_id, 'm.call.hangup', undefined, content).then(this.messageSent, this.messageSendFailed); this.state = 'ended'; + self.onHangup(); }; MatrixCall.prototype.gotUserMediaForInvite = function(stream) { @@ -233,6 +234,7 @@ angular.module('MatrixCall', []) MatrixCall.prototype.getUserMediaFailed = function() { this.onError("Couldn't start capturing audio! Is your microphone set up?"); + this.hangup(); }; MatrixCall.prototype.onIceConnectionStateChanged = function() {