diff options
author | David Baker <dbkr@matrix.org> | 2014-09-19 17:21:17 +0100 |
---|---|---|
committer | David Baker <dbkr@matrix.org> | 2014-09-19 17:23:55 +0100 |
commit | f6258221c1e8143f566f59a7d9983ccacf51a2af (patch) | |
tree | 192ec5f08c3cadd58897dfab7d2ebd56a7758871 /webclient/components | |
parent | SYWEB-32: made all input/textearea inherit the font of their parent (diff) | |
download | synapse-f6258221c1e8143f566f59a7d9983ccacf51a2af.tar.xz |
Join rooms if we're not already in them when accepting a call coming from that room.
SYWEB-55 #resolve
Diffstat (limited to 'webclient/components')
-rw-r--r-- | webclient/components/matrix/matrix-call.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js index fc02e1f62f..494a37f340 100644 --- a/webclient/components/matrix/matrix-call.js +++ b/webclient/components/matrix/matrix-call.js @@ -156,7 +156,22 @@ angular.module('MatrixCall', []) MatrixCall.prototype.answer = function() { console.log("Answering call "+this.call_id); + var self = this; + + var roomMembers = $rootScope.events.rooms[this.room_id].members; + if (roomMembers[matrixService.config().user_id].membership != 'join') { + console.log("We need to join the room before we can accept this call"); + matrixService.join(this.room_id).then(function() { + self.answer(); + }, function() { + console.log("Failed to join room: can't answer call!"); + self.onError("Unable to join room to answer call!"); + self.hangup(); + }); + return; + } + if (!this.localAVStream && !this.waitForLocalAVStream) { navigator.getUserMedia(this.getUserMediaVideoContraints(this.type), function(s) { self.gotUserMediaForAnswer(s); }, function(e) { self.getUserMediaFailed(e); }); this.state = 'wait_local_media'; |