diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2023-10-12 07:06:59 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2023-10-12 07:06:59 +0200 |
commit | ae756682d622a1cf7fb9469450a22cd4c7ba34ff (patch) | |
tree | 84476ede8c9f1ade8a1c9a3f94ddbfb6ab7d4091 | |
parent | ffb896b35f96ce5c32c652646b1ac8d12714ed56 (diff) |
Fix "silent" parameter not sent again when reconnecting
When a call was joined the value of the "silent" parameter was not
tracked by the signaling object, so if the call was joined again (for
example, in a forced reconnection, or if joining the call was deferred
because the room was not joined yet by the signaling) "silent" was
undefined, which was treated as "false" by the API.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | src/utils/signaling.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index cc9208de6..3166c4447 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -83,6 +83,7 @@ function Base(settings) { this.currentRoomToken = null this.currentCallToken = null this.currentCallFlags = null + this.currentCallSilent = null this.nextcloudSessionId = null this.handlers = {} this.features = {} @@ -172,6 +173,7 @@ Signaling.Base.prototype.getCurrentCallFlags = function() { Signaling.Base.prototype._resetCurrentCallParameters = function() { this.currentCallToken = null this.currentCallFlags = null + this.currentCallSilent = null } Signaling.Base.prototype.disconnect = function() { @@ -242,7 +244,7 @@ Signaling.Base.prototype.joinRoom = function(token, sessionId) { resolve() if (this.currentCallToken === token) { // We were in this call before, join again. - this.joinCall(token, this.currentCallFlags) + this.joinCall(token, this.currentCallFlags, this.currentCallSilent) } else { this._resetCurrentCallParameters() } @@ -295,6 +297,7 @@ Signaling.Base.prototype.joinCall = function(token, flags, silent) { .then(function() { this.currentCallToken = token this.currentCallFlags = flags + this.currentCallSilent = silent this._trigger('joinCall', [token]) resolve() this._joinCallSuccess(token) @@ -520,7 +523,7 @@ Signaling.Internal.prototype._startPullingMessages = function() { localParticipant = message.data.find(participant => participant.sessionId === this.sessionId) if (this._joinCallAgainOnceDisconnected && !localParticipant.inCall) { this._joinCallAgainOnceDisconnected = false - this.joinCall(this.currentCallToken, this.currentCallFlags) + this.joinCall(this.currentCallToken, this.currentCallFlags, this.currentCallSilent) } break @@ -1181,7 +1184,7 @@ Signaling.Standalone.prototype._joinRoomSuccess = function(token, nextcloudSessi }.bind(this)) } -Signaling.Standalone.prototype.joinCall = function(token, flags) { +Signaling.Standalone.prototype.joinCall = function(token, flags, silent) { if (this.signalingRoomJoined !== token) { console.debug('Not joined room yet, not joining call', token) @@ -1195,6 +1198,7 @@ Signaling.Standalone.prototype.joinCall = function(token, flags) { this.pendingJoinCall = { token, flags, + silent, resolve, reject, } @@ -1214,6 +1218,7 @@ Signaling.Standalone.prototype.joinCall = function(token, flags) { this.currentCallToken = token this.currentCallFlags = flags + this.currentCallSilent = silent this._trigger('joinCall', [token]) resolve() @@ -1230,7 +1235,7 @@ Signaling.Standalone.prototype.joinResponseReceived = function(data, token) { const pendingJoinCallResolve = this.pendingJoinCall.resolve const pendingJoinCallReject = this.pendingJoinCall.reject - this.joinCall(this.pendingJoinCall.token, this.pendingJoinCall.flags).then(() => { + this.joinCall(this.pendingJoinCall.token, this.pendingJoinCall.flags, this.pendingJoinCall.silent).then(() => { pendingJoinCallResolve() }).catch(error => { pendingJoinCallReject(error) |