Browse Source

Join call after user has joined the room on the standalone signaling server.

Otherwise there is a race condition of the Nextcloud server notifying the
signaling server about the user in the call before the user has joined the
room.

Signed-off-by: Joachim Bauch <bauch@struktur.de>
pull/910/head
Joachim Bauch 8 years ago
parent
commit
91f2c90176
Failed to extract signature
  1. 16
      js/signaling.js

16
js/signaling.js

@ -799,6 +799,16 @@
}.bind(this));
};
OCA.Talk.Signaling.Standalone.prototype.joinCall = function(token) {
if (this.signalingRoomJoined !== token) {
console.log("Not joined room yet, not joining call", token);
this.pendingJoinCall = token;
return;
}
OCA.Talk.Signaling.Base.prototype.joinCall.apply(this, arguments);
};
OCA.Talk.Signaling.Standalone.prototype._joinCallSuccess = function(/* token */) {
// Update room list to fetch modified properties.
this.internalSyncRooms();
@ -811,6 +821,11 @@
OCA.Talk.Signaling.Standalone.prototype.joinResponseReceived = function(data, token) {
console.log("Joined", data, token);
this.signalingRoomJoined = token;
if (token === this.pendingJoinCall) {
this.joinCall(this.pendingJoinCall);
this.pendingJoinCall = null;
}
if (this.roomCollection) {
// The list of rooms is not fetched from the server. Update ping
// of joined room so it gets sorted to the top.
@ -832,6 +847,7 @@
}
}, function(data) {
console.log("Left", data);
this.signalingRoomJoined = null;
// Any users we previously had in the room also "left" for us.
var leftUsers = _.keys(this.joinedUsers);
if (leftUsers.length) {

Loading…
Cancel
Save