diff options
author | Joas Schilling <coding@schilljs.com> | 2020-05-12 11:37:05 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-05-12 11:40:22 +0300 |
commit | 40fa7c6f21ecf204de44320752d4adbf2ff817cb (patch) | |
tree | e9e0baf2090028b1eb11c3cc9ffffb7548a74792 /src/utils/signaling.js | |
parent | a7bcad34d706c3c5f9ae0bb4313cb0f2b479ebb4 (diff) |
Refresh the session before closing the connection
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/utils/signaling.js')
-rw-r--r-- | src/utils/signaling.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index 1661af6a0..efee6f111 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -27,6 +27,7 @@ */ import { pullSignalingMessages } from '../services/signalingService' +import { rejoinConversation } from '../services/participantsService' import CancelableRequest from './cancelableRequest' import { EventBus } from '../services/EventBus' import axios from '@nextcloud/axios' @@ -695,9 +696,18 @@ Signaling.Standalone.prototype.forceReconnect = function(newSession, flags) { // Mark this session as "no longer in the call". this.leaveCall(this.currentCallToken, true) } - this.sendBye() - } - if (this.socket) { + + rejoinConversation(this.currentRoomToken) + .then(response => { + this.nextcloudSessionId = response.data.ocs.data.sessionId + + this.sendBye() + if (this.socket) { + // Trigger reconnect. + this.socket.close() + } + }) + } else if (this.socket) { // Trigger reconnect. this.socket.close() } |