summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-10 18:35:05 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-10 18:35:05 +0200
commit44998ca4508c9ed13e563383f1209e7be6ee2e56 (patch)
tree90870576ecb61d488efb0d9c9ec7697d46ab98a1 /webclient/components
parentShow echoed emote with transparency (diff)
parentAnimation on call end icon. (diff)
downloadsynapse-44998ca4508c9ed13e563383f1209e7be6ee2e56.tar.xz
Merge remote-tracking branch 'origin/develop' into webclient_initialSync
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/matrix-call.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js
index feb113f60d..68bde78862 100644
--- a/webclient/components/matrix/matrix-call.js
+++ b/webclient/components/matrix/matrix-call.js
@@ -114,7 +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();
+        if (self.onHangup) self.onHangup(self);
     };
 
     MatrixCall.prototype.gotUserMediaForInvite = function(stream) {
@@ -178,6 +178,10 @@ angular.module('MatrixCall', [])
 
     MatrixCall.prototype.gotRemoteIceCandidate = function(cand) {
         console.trace("Got ICE candidate from remote: "+cand);
+        if (this.state == 'ended') {
+            console.trace("Ignoring remote ICE candidate because call has ended");
+            return;
+        }
         var candidateObject = new RTCIceCandidate({
             sdpMLineIndex: cand.label,
             candidate: cand.candidate
@@ -294,10 +298,10 @@ angular.module('MatrixCall', [])
         self = this;
         $rootScope.$apply(function() {
             self.state = 'ended';
-            this.hangupParty = 'remote';
+            self.hangupParty = 'remote';
             self.stopAllMedia();
-            this.peerConn.close();
-            self.onHangup();
+            if (self.peerConn.signalingState != 'closed') self.peerConn.close();
+            if (self.onHangup) self.onHangup(self);
         });
     };
 
@@ -313,7 +317,7 @@ angular.module('MatrixCall', [])
         this.hangupParty = 'remote';
         this.stopAllMedia();
         this.peerConn.close();
-        this.onHangup();
+        if (this.onHangup) this.onHangup(self);
     };
 
     return MatrixCall;