From e7bf643d8b18db2f69039b6a87a73bd129d372c0 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 17 Apr 2019 21:44:52 -0600 Subject: [PATCH] Don't repackage the ValidatedDiscoveryConfig It's usable as-is, and we can add things to it when we need to (ie: integrations). --- src/vector/index.js | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index e053f8d8..5fff5460 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -494,30 +494,13 @@ async function verifyServerConfig() { } const validatedConfig = AutoDiscoveryUtils.buildValidatedConfigFromDiscovery(serverName, result); + + // Just in case we ever have to debug this console.log("Using homeserver config:", validatedConfig); - // Build our own discovery result for distribution within the app - const configResult = { - "m.homeserver": { - "base_url": validatedConfig.hsUrl, - "server_name": validatedConfig.hsName, - "server_name_different": validatedConfig.hsNameIsDifferent, - }, - "m.identity_server": { - "base_url": validatedConfig.isUrl, - "enabled": validatedConfig.identityEnabled, - }, - }; - - // Copy over any other keys that may be of interest - for (const key of Object.keys(result)) { - if (key === "m.homeserver" || key === "m.identity_server") continue; - configResult[key] = JSON.parse(JSON.stringify(result[key])); // deep clone - } - // Add the newly built config to the actual config for use by the app console.log("Updating SdkConfig with validated discovery information"); - SdkConfig.add({"validated_discovery_config": configResult}); + SdkConfig.add({"validated_discovery_config": validatedConfig}); return SdkConfig.get(); }