Do not defien Element Stuff in the SDK

This commit is contained in:
Benoit Marty 2021-01-04 18:16:12 +01:00
parent c11a50f7ff
commit c34fea2932
2 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,6 @@ interface PermalinkService {
companion object { companion object {
const val MATRIX_TO_URL_BASE = "https://matrix.to/#/" const val MATRIX_TO_URL_BASE = "https://matrix.to/#/"
const val MATRIX_TO_CUSTOM_SCHEME_URL_BASE = "element://"
} }
/** /**

View File

@ -166,7 +166,7 @@ class HomeActivity :
intent?.dataString?.let { deepLink -> intent?.dataString?.let { deepLink ->
val resolvedLink = when { val resolvedLink = when {
deepLink.startsWith(PermalinkService.MATRIX_TO_URL_BASE) -> deepLink deepLink.startsWith(PermalinkService.MATRIX_TO_URL_BASE) -> deepLink
deepLink.startsWith(PermalinkService.MATRIX_TO_CUSTOM_SCHEME_URL_BASE) -> { deepLink.startsWith(MATRIX_TO_CUSTOM_SCHEME_URL_BASE) -> {
// This is a bit ugly, but for now just convert to matrix.to link for compatibility // This is a bit ugly, but for now just convert to matrix.to link for compatibility
when { when {
deepLink.startsWith(USER_LINK_PREFIX) -> deepLink.substring(USER_LINK_PREFIX.length) deepLink.startsWith(USER_LINK_PREFIX) -> deepLink.substring(USER_LINK_PREFIX.length)
@ -413,7 +413,8 @@ class HomeActivity :
} }
} }
private const val ROOM_LINK_PREFIX = "${PermalinkService.MATRIX_TO_CUSTOM_SCHEME_URL_BASE}room/" private const val MATRIX_TO_CUSTOM_SCHEME_URL_BASE = "element://"
private const val USER_LINK_PREFIX = "${PermalinkService.MATRIX_TO_CUSTOM_SCHEME_URL_BASE}user/" private const val ROOM_LINK_PREFIX = "${MATRIX_TO_CUSTOM_SCHEME_URL_BASE}room/"
private const val USER_LINK_PREFIX = "${MATRIX_TO_CUSTOM_SCHEME_URL_BASE}user/"
} }
} }