Skip to content

Commit

Permalink
Fix call flags not kept after forced reconnections
Browse files Browse the repository at this point in the history
When joining a call again due to a forced reconnection the same flags
used when originally joining the call should be provided again;
otherwise, if no flags are provided, the default flags would be used by
the server, which may not match the real call flags.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu authored and Backportbot committed May 16, 2019
1 parent 5f92aed commit ccc6c91
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
this.sessionId = '';
this.currentRoomToken = null;
this.currentCallToken = null;
this.currentCallFlags = null;
this.handlers = {};
this.features = {};
this.pendingChatRequests = [];
Expand Down Expand Up @@ -136,6 +137,7 @@
OCA.Talk.Signaling.Base.prototype.disconnect = function() {
this.sessionId = '';
this.currentCallToken = null;
this.currentCallFlags = null;
};

OCA.Talk.Signaling.Base.prototype.hasFeature = function(feature) {
Expand Down Expand Up @@ -173,6 +175,7 @@
if (this.currentCallToken) {
this.leaveCall(this.currentCallToken);
this.currentCallToken = null;
this.currentCallFlags = null;
}
};

Expand Down Expand Up @@ -232,9 +235,10 @@
this._runPendingChatRequests();
if (this.currentCallToken === token) {
// We were in this call before, join again.
this.joinCall(token);
this.joinCall(token, this.currentCallFlags);
} else {
this.currentCallToken = null;
this.currentCallFlags = null;
}
this._joinRoomSuccess(token, result.ocs.data.sessionId);
}.bind(this),
Expand Down Expand Up @@ -311,6 +315,7 @@
},
success: function () {
this.currentCallToken = token;
this.currentCallFlags = flags;
this._trigger('joinCall', [token]);
this._joinCallSuccess(token);
}.bind(this),
Expand Down Expand Up @@ -341,6 +346,7 @@
// We left the current call.
if (!keepToken && token === this.currentCallToken) {
this.currentCallToken = null;
this.currentCallFlags = null;
}
}.bind(this)
});
Expand Down

0 comments on commit ccc6c91

Please sign in to comment.