This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ limitations under the License.
52
52
*/
53
53
54
54
import MatrixClientPeg from './MatrixClientPeg' ;
55
- import UserSettingsStore from './UserSettingsStore' ;
56
55
import PlatformPeg from './PlatformPeg' ;
57
56
import Modal from './Modal' ;
58
57
import sdk from './index' ;
@@ -245,9 +244,7 @@ function _onAction(payload) {
245
244
return ;
246
245
} else if ( members . length === 2 ) {
247
246
console . log ( "Place %s call in %s" , payload . type , payload . room_id ) ;
248
- const call = Matrix . createNewMatrixCall ( MatrixClientPeg . get ( ) , payload . room_id , {
249
- forceTURN : UserSettingsStore . getLocalSetting ( 'webRtcForceTURN' , false ) ,
250
- } ) ;
247
+ const call = Matrix . createNewMatrixCall ( MatrixClientPeg . get ( ) , payload . room_id ) ;
251
248
placeCall ( call ) ;
252
249
} else { // > 2
253
250
dis . dispatch ( {
Original file line number Diff line number Diff line change @@ -136,13 +136,17 @@ class MatrixClientPeg {
136
136
}
137
137
138
138
_createClient ( creds : MatrixClientCreds ) {
139
+ // XXX: This is here and as a require because apparently circular dependencies
140
+ // are just broken in webpack (https://github.com/webpack/webpack/issues/1788)
141
+ const UserSettingsStore = require ( './UserSettingsStore' ) ;
139
142
const opts = {
140
143
baseUrl : creds . homeserverUrl ,
141
144
idBaseUrl : creds . identityServerUrl ,
142
145
accessToken : creds . accessToken ,
143
146
userId : creds . userId ,
144
147
deviceId : creds . deviceId ,
145
148
timelineSupport : true ,
149
+ forceTURN : UserSettingsStore . getLocalSetting ( 'webRtcForceTURN' , false ) ,
146
150
} ;
147
151
148
152
this . matrixClient = createMatrixClient ( opts , this . indexedDbWorkerScript ) ;
Original file line number Diff line number Diff line change @@ -877,6 +877,11 @@ module.exports = React.createClass({
877
877
// TODO: this ought to be a separate component so that we don't need
878
878
// to rebind the onChange each time we render
879
879
const onChange = ( e ) => {
880
+ // XXX: awful, but at time of writing, granular settings has landed on
881
+ // develop which will almost certainly mean we'll handle this differently.
882
+ if ( setting . id === 'webRtcForceTURN' ) {
883
+ MatrixClientPeg . get ( ) . setForceTURN ( e . target . checked ) ;
884
+ }
880
885
UserSettingsStore . setLocalSetting ( setting . id , e . target . checked ) ;
881
886
if ( setting . fn ) setting . fn ( e . target . checked ) ;
882
887
} ;
You can’t perform that action at this time.
0 commit comments