Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Only expose the fallback_hs_url if the homeserver is the default homeserver #2971

Merged
merged 2 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/AutoDiscoveryUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class ValidatedServerConfig {

isUrl: string;
identityEnabled: boolean;

isDefault: boolean;
}

export default class AutoDiscoveryUtils {
Expand Down Expand Up @@ -99,6 +101,7 @@ export default class AutoDiscoveryUtils {
hsNameIsDifferent: url.hostname !== preferredHomeserverName,
isUrl: preferredIdentityUrl,
identityEnabled: !SdkConfig.get()['disable_identity_server'],
isDefault: false,
});
}
}