From bb163576360e0defc3265f12fc08c5949f97ee69 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 14 May 2019 13:06:56 -0600 Subject: [PATCH 1/2] Flag all generated configs as non-default by default The app is expected to flag a particular config themselves as default. This is primarily intended so that other parts of the app can determine what to do based on whether or not the config is a default config. See https://github.com/vector-im/riot-web/issues/9290 --- src/utils/AutoDiscoveryUtils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/AutoDiscoveryUtils.js b/src/utils/AutoDiscoveryUtils.js index 318c706136..0850039344 100644 --- a/src/utils/AutoDiscoveryUtils.js +++ b/src/utils/AutoDiscoveryUtils.js @@ -26,6 +26,8 @@ export class ValidatedServerConfig { isUrl: string; identityEnabled: boolean; + + isDefault: boolean; } export default class AutoDiscoveryUtils { @@ -99,6 +101,7 @@ export default class AutoDiscoveryUtils { hsNameIsDifferent: url.hostname !== preferredHomeserverName, isUrl: preferredIdentityUrl, identityEnabled: !SdkConfig.get()['disable_identity_server'], + isDefault: false, }); } } From 34719b9a2e8f4734d9a9367823142ffdb7a32655 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 14 May 2019 13:10:02 -0600 Subject: [PATCH 2/2] Only expose the fallback_hs_url if the homeserver is the default HS See https://github.com/vector-im/riot-web/issues/9290 --- src/components/structures/MatrixChat.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 4198980a17..38f597f673 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -203,9 +203,12 @@ export default React.createClass({ }; }, - // TODO: TravisR - Remove this or put it somewhere else getFallbackHsUrl: function() { - return this.props.config.fallback_hs_url; + if (this.props.serverConfig.isDefault) { + return this.props.config.fallback_hs_url; + } else { + return null; + } }, getServerProperties() {