From 21d0a28150630264268b6d825bf90720079386f3 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Thu, 9 Sep 2021 17:17:11 +0200 Subject: [PATCH] Permalink: move supported hosts to config file --- .../vector/app/features/link/LinkHandlerActivity.kt | 11 +---------- vector/src/main/res/values/config.xml | 11 +++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt b/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt index a0b8efd5aa..487ce90dd9 100644 --- a/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt +++ b/vector/src/main/java/im/vector/app/features/link/LinkHandlerActivity.kt @@ -63,7 +63,7 @@ class LinkHandlerActivity : VectorBaseActivity() { if (uri.getQueryParameter(LoginConfig.CONFIG_HS_PARAMETER) != null) { handleConfigUrl(uri) - } else if (SUPPORTED_HOSTS.contains(uri.host)) { + } else if (resources.getStringArray(R.array.permalink_supported_hosts).contains(uri.host)) { handleSupportedHostUrl(uri) } else { // Other links are not yet handled, but should not come here (manifest configuration error?) @@ -175,15 +175,6 @@ class LinkHandlerActivity : VectorBaseActivity() { } companion object { - private val SUPPORTED_HOSTS = listOf( - // Regular Element Web instance - "app.element.io", - // Other known instances of Element Web - "develop.element.io", - "staging.element.io", - // Previous Web instance, kept for compatibility reason - "riot.im" - ) private val SUPPORTED_PATHS = listOf( "/#/room/", "/#/user/", diff --git a/vector/src/main/res/values/config.xml b/vector/src/main/res/values/config.xml index 30ca8d7f56..a8e80f82ed 100755 --- a/vector/src/main/res/values/config.xml +++ b/vector/src/main/res/values/config.xml @@ -26,4 +26,15 @@ gitter.im + + + + app.element.io + + develop.element.io + staging.element.io + + riot.im + +