mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Do not defien Element Stuff in the SDK
This commit is contained in:
parent
c11a50f7ff
commit
c34fea2932
2 changed files with 6 additions and 6 deletions
|
@ -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://"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -165,8 +165,8 @@ class HomeActivity :
|
||||||
private fun handleIntent(intent: Intent?) {
|
private fun handleIntent(intent: Intent?) {
|
||||||
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)
|
||||||
|
@ -176,7 +176,7 @@ class HomeActivity :
|
||||||
activeSessionHolder.getSafeActiveSession()?.permalinkService()?.createPermalink(it)
|
activeSessionHolder.getSafeActiveSession()?.permalinkService()?.createPermalink(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
permalinkHandler.launch(
|
permalinkHandler.launch(
|
||||||
|
@ -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/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue