File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1151,11 +1151,8 @@ export const SETTINGS: Settings = {
11511151 displayName : _td ( "settings|inline_url_previews_default" ) ,
11521152 default : true ,
11531153 controller : new RequiresSettingsController ( [ UIFeature . URLPreviews ] , false , ( c ) => {
1154- if (
1155- c [ "io.element.msc4452.preview_url" ] ?. enabled === undefined ||
1156- c [ "io.element.msc4452.preview_url" ] . enabled
1157- ) {
1158- // If there is no capability, assume true.
1154+ if ( c [ "io.element.msc4452.preview_url" ] ?. enabled !== false ) {
1155+ // If the capability is not listed, or explicitly true then do not disable.
11591156 return false ;
11601157 }
11611158 return _t ( "common|disabled_by_homeserver" ) ;
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ export default class RequiresSettingsController extends MatrixClientBackedContro
3636 }
3737 }
3838
39+ /**
40+ * Checks if the `isCapabilityDisabled` function blocks the setting.
41+ * @returns `true` or a string if the feature is disabled by the feature, otherwise false.
42+ */
3943 private get isBlockedByCapabilites ( ) : boolean | string {
4044 if ( ! this . isCapabilityDisabled ) {
4145 return false ;
@@ -44,7 +48,7 @@ export default class RequiresSettingsController extends MatrixClientBackedContro
4448 // at least one call to get capaibilies.
4549 const cachedCaps = this . client ?. getCachedCapabilities ( ) ;
4650 if ( ! cachedCaps ) {
47- // return forced value if caps aren't available yet.
51+ // If we do not have any capabilites yet, then assume the setting IS blocked .
4852 return true ;
4953 }
5054 return this . isCapabilityDisabled ( cachedCaps ) ;
You can’t perform that action at this time.
0 commit comments