mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Fix support of riot.im/develop urls.
This commit is contained in:
parent
6dd4d4d906
commit
3367ed6765
@ -92,9 +92,11 @@ class LinkHandlerActivity : VectorBaseActivity() {
|
|||||||
|
|
||||||
private fun convertUriToPermalink(uri: Uri): String? {
|
private fun convertUriToPermalink(uri: Uri): String? {
|
||||||
val path = SUPPORTED_PATHS.find { it in uri.toString() } ?: return null
|
val path = SUPPORTED_PATHS.find { it in uri.toString() } ?: return null
|
||||||
|
// https://riot.im/develop/#/room/#element-android:matrix.org -> https://matrix.to/#/#element-android:matrix.org
|
||||||
|
// https://app.element.io/#/room/#element-android:matrix.org -> https://matrix.to/#/#element-android:matrix.org
|
||||||
return uri
|
return uri
|
||||||
.toString()
|
.toString()
|
||||||
.replace(uri.host + path, "$MATRIX_TO_HOST/#")
|
.replace(uri.toString().substring(0, uri.toString().indexOf(path) + path.length), "https://$MATRIX_TO_HOST/#")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startPermalinkHandler(permalink: String) {
|
private fun startPermalinkHandler(permalink: String) {
|
||||||
|
Loading…
Reference in New Issue
Block a user