From 6d23182f5ff8f675876c9cfa62d15cf34e7eb476 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 17 Nov 2017 14:54:44 +0000 Subject: [PATCH 1/4] Fix the force TURN option The call object is created within the js-sdk for inbound calls, so we never got the chance to set it. --- src/CallHandler.js | 5 +---- src/MatrixClientPeg.js | 4 ++++ src/components/structures/UserSettings.js | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index a9539d40e1..dd9d93709f 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -52,7 +52,6 @@ limitations under the License. */ import MatrixClientPeg from './MatrixClientPeg'; -import UserSettingsStore from './UserSettingsStore'; import PlatformPeg from './PlatformPeg'; import Modal from './Modal'; import sdk from './index'; @@ -245,9 +244,7 @@ function _onAction(payload) { return; } else if (members.length === 2) { console.log("Place %s call in %s", payload.type, payload.room_id); - const call = Matrix.createNewMatrixCall(MatrixClientPeg.get(), payload.room_id, { - forceTURN: UserSettingsStore.getLocalSetting('webRtcForceTURN', false), - }); + const call = Matrix.createNewMatrixCall(MatrixClientPeg.get(), payload.room_id); placeCall(call); } else { // > 2 dis.dispatch({ diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 0c3d5b3775..6135a91dea 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -136,6 +136,9 @@ class MatrixClientPeg { } _createClient(creds: MatrixClientCreds) { + // XXX: This is here and as a require because apparently circular dependencies + // are just broken in webpack (https://github.com/webpack/webpack/issues/1788) + const UserSettingsStore = require('./UserSettingsStore'); const opts = { baseUrl: creds.homeserverUrl, idBaseUrl: creds.identityServerUrl, @@ -143,6 +146,7 @@ class MatrixClientPeg { userId: creds.userId, deviceId: creds.deviceId, timelineSupport: true, + forceTURN: UserSettingsStore.getLocalSetting('webRtcForceTURN', false), }; this.matrixClient = createMatrixClient(opts, this.indexedDbWorkerScript); diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 68ea932f93..7d45179a1b 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -877,6 +877,11 @@ module.exports = React.createClass({ // TODO: this ought to be a separate component so that we don't need // to rebind the onChange each time we render const onChange = (e) => { + // XXX: awful, but at time of writing, granular settings has landed on + // develop which will almost certainly mean we'll handle this differently. + if (setting.id === 'webRtcForceTURN') { + MatrixClientPeg.get().setForceTURN(e.target.checked); + } UserSettingsStore.setLocalSetting(setting.id, e.target.checked); if (setting.fn) setting.fn(e.target.checked); }; From 8bd040a443084b09a694204639cf44ee819abaee Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 17 Nov 2017 15:58:05 +0000 Subject: [PATCH 2/4] Released js-sdk --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 414275cccc..4b8c49bbbd 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "isomorphic-fetch": "^2.2.1", "linkifyjs": "^2.1.3", "lodash": "^4.13.1", - "matrix-js-sdk": "0.9.0", + "matrix-js-sdk": "0.9.1", "optimist": "^0.6.1", "prop-types": "^15.5.8", "querystring": "^0.2.0", From c32b42886bcf44bd6ebf44721575534a27ac92fe Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 17 Nov 2017 16:03:50 +0000 Subject: [PATCH 3/4] Prepare changelog for v0.11.1 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86a1002a48..9c0ea57a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [0.11.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.11.1) (2017-11-17) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.11.0...v0.11.1) + + * Fix the force TURN option + [\#1621](https://github.com/matrix-org/matrix-react-sdk/pull/1621) + Changes in [0.11.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.11.0) (2017-11-15) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.11.0-rc.3...v0.11.0) From 394e450526dddade1c3b224e5b48f980fefdf738 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 17 Nov 2017 16:03:50 +0000 Subject: [PATCH 4/4] v0.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b8c49bbbd..2970beb6b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.11.0", + "version": "0.11.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {