mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-17 03:23:56 +01:00
Join rooms if we're not already in them when accepting a call coming from that room.
SYWEB-55 #resolve
This commit is contained in:
parent
68e534777c
commit
f6258221c1
1 changed files with 15 additions and 0 deletions
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue