mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Handle new mobile config url.
This commit is contained in:
parent
f186a00515
commit
4d7cd7319b
@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
adb shell am start -a android.intent.action.VIEW -d "https://riot.im/config/config?hs_url=https%3A%2F%2Fmozilla-test.modular.im"
|
||||
adb shell am start -a android.intent.action.VIEW -d "https://mobile.element.io?hs_url=https%3A%2F%2Fmozilla-test.modular.im"
|
||||
|
@ -145,6 +145,7 @@
|
||||
<data android:scheme="https" />
|
||||
<data android:host="riot.im" />
|
||||
<data android:host="app.element.io" />
|
||||
<data android:host="mobile.element.io" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
@ -59,7 +59,7 @@ class LinkHandlerActivity : VectorBaseActivity() {
|
||||
return
|
||||
}
|
||||
|
||||
if (uri.path == PATH_CONFIG) {
|
||||
if (uri.getQueryParameter(CONFIG_PATH_HS_PARAMETER) != null) {
|
||||
handleConfigUrl(uri)
|
||||
} else if (SUPPORTED_HOSTS.contains(uri.host)) {
|
||||
handleSupportedHostUrl(uri)
|
||||
@ -155,7 +155,7 @@ class LinkHandlerActivity : VectorBaseActivity() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PATH_CONFIG = "/config/config"
|
||||
private const val CONFIG_PATH_HS_PARAMETER = "hs_url"
|
||||
|
||||
private val SUPPORTED_HOSTS = arrayOf("app.element.io", "riot.im")
|
||||
private val SUPPORTED_PATHS = arrayOf("/#/room", "/#/user", "/#/group")
|
||||
|
@ -22,7 +22,7 @@ import kotlinx.android.parcel.Parcelize
|
||||
|
||||
/**
|
||||
* Parameters extracted from a configuration url
|
||||
* Ex: https://riot.im/config/config?hs_url=https%3A%2F%2Fexample.modular.im&is_url=https%3A%2F%2Fcustom.identity.org
|
||||
* Ex: https://mobile.element.io?hs_url=https%3A%2F%2Fexample.modular.im&is_url=https%3A%2F%2Fcustom.identity.org
|
||||
*
|
||||
* Note: On RiotX, identityServerUrl will never be used, so is declared private. Keep it for compatibility reason.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user