From 0970fdd7e7dadc6ec754c83ff448a0e0dca8d83a Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 2 May 2016 14:09:57 -0500 Subject: [PATCH 1/3] Clears external connect data after using it --- connection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/connection.js b/connection.js index d66dd24f3..97fa602d8 100644 --- a/connection.js +++ b/connection.js @@ -31,6 +31,7 @@ function checkForAttachParametersAndConnect(id, password, connection) { var attachOptions = window.XMPPAttachInfo.data; if(attachOptions) { connection.attach(attachOptions); + delete window.XMPPAttachInfo.data; } else { connection.connect({id, password}); } From 6b5f6ec7044ae7fc1584b757ce08ecc072eac8c0 Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 2 May 2016 14:22:02 -0500 Subject: [PATCH 2/3] Fixes issue with multiple room query parameters added to bosh url --- connection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.js b/connection.js index 97fa602d8..d5f405448 100644 --- a/connection.js +++ b/connection.js @@ -52,11 +52,11 @@ function checkForAttachParametersAndConnect(id, password, connection) { */ function connect(id, password, roomName) { - let connectionConfig = config; + let connectionConfig = Object.assign({}, config); connectionConfig.bosh += '?room=' + roomName; let connection - = new JitsiMeetJS.JitsiConnection(null, config.token, config); + = new JitsiMeetJS.JitsiConnection(null, config.token, connectionConfig); return new Promise(function (resolve, reject) { connection.addEventListener( From d6ef36b4b4322f4bd0f1dcba00e24b53afe24baa Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 2 May 2016 14:47:40 -0500 Subject: [PATCH 3/3] Passes the room name to connect when using authentication --- connection.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/connection.js b/connection.js index d5f405448..5add17e48 100644 --- a/connection.js +++ b/connection.js @@ -96,13 +96,14 @@ function connect(id, password, roomName) { * Show Authentication Dialog and try to connect with new credentials. * If failed to connect because of PASSWORD_REQUIRED error * then ask for password again. + * @param {string} [roomName] * @returns {Promise} */ -function requestAuth() { +function requestAuth(roomName) { return new Promise(function (resolve, reject) { let authDialog = LoginDialog.showAuthDialog( function (id, password) { - connect(id, password).then(function (connection) { + connect(id, password, roomName).then(function (connection) { authDialog.close(); resolve(connection); }, function (err) { @@ -156,7 +157,7 @@ export function openConnection({id, password, retry, roomName}) { if (config.token) { throw err; } else { - return requestAuth(); + return requestAuth(roomName); } } else { throw err;