Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/utils/signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ Signaling.Standalone.prototype._joinRoomSuccess = function(token, nextcloudSessi
'sessionid': nextcloudSessionId,
},
}, function(data) {
this.joinResponseReceived(data, token)
this.joinResponseReceived(data, token, nextcloudSessionId)
}.bind(this))
}

Expand Down Expand Up @@ -958,8 +958,16 @@ Signaling.Standalone.prototype.joinCall = function(token, flags) {
return Signaling.Base.prototype.joinCall.apply(this, arguments)
}

Signaling.Standalone.prototype.joinResponseReceived = function(data, token) {
Signaling.Standalone.prototype.joinResponseReceived = function(data, token, nextcloudSessionId) {
console.debug('Joined', data, token)

if (data.type === 'error') {
// Keep trying until the room is joined in the signaling server too.
this._joinRoomSuccess(token, nextcloudSessionId)

return
}

this.signalingRoomJoined = token
if (this.pendingJoinCall && token === this.pendingJoinCall.token) {
const pendingJoinCallResolve = this.pendingJoinCall.resolve
Expand All @@ -973,16 +981,6 @@ Signaling.Standalone.prototype.joinResponseReceived = function(data, token) {

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.
this.roomCollection.forEach(function(room) {
if (room.get('token') === token) {
room.set('lastPing', (new Date()).getTime() / 1000)
}
})
this.roomCollection.sort()
}
}

Signaling.Standalone.prototype._doLeaveRoom = function(token) {
Expand Down