Fix support of riot.im/develop urls.

This commit is contained in:
Onuray Sahin 2020-09-07 20:02:06 +03:00
parent 6dd4d4d906
commit 3367ed6765

View File

@ -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) {