mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 02:45:53 +03:00
Fix support of riot.im/develop urls.
This commit is contained in:
parent
6dd4d4d906
commit
3367ed6765
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue