Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-04-06 09:46:50 +0300
committerGitHub <noreply@github.com>2022-04-06 09:46:50 +0300
commit43ccc6514b3c18b76ca1e1d5280d9cce156f49e0 (patch)
tree330ee543947b5e2184e3cba28e1f1ff00138c428 /src/utils/signaling.js
parentc510d5816ac5517d71b4f898378fa5e2b5e82fca (diff)
parent6d3df1431edc9b88c21ad5825b8fabdcbe85ddee (diff)
Merge pull request #7080 from nextcloud/fix-forced-reconnections-when-the-hpb-is-not-used
Fix forced reconnections when the HPB is not used
Diffstat (limited to 'src/utils/signaling.js')
-rw-r--r--src/utils/signaling.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js
index fab0e2a86..6b6fbab32 100644
--- a/src/utils/signaling.js
+++ b/src/utils/signaling.js
@@ -360,6 +360,8 @@ function Internal(settings) {
this.sendInterval = window.setInterval(function() {
this.sendPendingMessages()
}.bind(this), 500)
+
+ this._joinCallAgainOnceDisconnected = false
}
Internal.prototype = new Signaling.Base()
@@ -398,8 +400,9 @@ Signaling.Internal.prototype.forceReconnect = function(newSession, flags) {
// FIXME Naive reconnection routine; as the same session is kept peers
// must be explicitly ended before the reconnection is forced.
- this.leaveCall(this.currentCallToken, true)
- this.joinCall(this.currentCallToken, this.currentCallFlags)
+ this.leaveCall(this.currentCallToken, true).then(() => {
+ this._joinCallAgainOnceDisconnected = true
+ })
}
Signaling.Internal.prototype._sendMessageWithCallback = function(ev) {
@@ -424,11 +427,14 @@ Signaling.Internal.prototype._sendMessages = function(messages) {
}
Signaling.Internal.prototype._joinRoomSuccess = function(token, sessionId) {
+ this._joinCallAgainOnceDisconnected = false
+
this.sessionId = sessionId
this._startPullingMessages()
}
Signaling.Internal.prototype._doLeaveRoom = function(token) {
+ this._joinCallAgainOnceDisconnected = false
}
Signaling.Internal.prototype.sendCallMessage = function(data) {
@@ -470,11 +476,20 @@ Signaling.Internal.prototype._startPullingMessages = function() {
}
result.data.ocs.data.forEach(message => {
+ let localParticipant
+
this._trigger('onBeforeReceiveMessage', [message])
switch (message.type) {
case 'usersInRoom':
this._trigger('usersInRoom', [message.data])
this._trigger('participantListChanged')
+
+ localParticipant = message.data.find(participant => participant.sessionId === this.sessionId)
+ if (this._joinCallAgainOnceDisconnected && !localParticipant.inCall) {
+ this._joinCallAgainOnceDisconnected = false
+ this.joinCall(this.currentCallToken, this.currentCallFlags)
+ }
+
break
case 'message':
if (typeof (message.data) === 'string') {