feat: Check Hometown/Glitch server instanceinfo for translation support (#718)
Previous code only looked for translation support on Mastodon servers. It may be present on Hometown/Glitch servers too, so check. Fixes #714
This commit is contained in:
parent
84fdf4abb7
commit
51c4469e85
|
@ -116,7 +116,7 @@ data class Server(
|
||||||
val capabilities = capabilitiesFromServerVersion(serverKind, version)
|
val capabilities = capabilitiesFromServerVersion(serverKind, version)
|
||||||
|
|
||||||
when (serverKind) {
|
when (serverKind) {
|
||||||
MASTODON -> {
|
GLITCH, HOMETOWN, MASTODON -> {
|
||||||
if (instanceV2.configuration.translation.enabled) {
|
if (instanceV2.configuration.translation.enabled) {
|
||||||
capabilities[ORG_JOINMASTODON_STATUSES_TRANSLATE] = when {
|
capabilities[ORG_JOINMASTODON_STATUSES_TRANSLATE] = when {
|
||||||
version >= "4.2.0".toVersion() -> "1.1.0".toVersion()
|
version >= "4.2.0".toVersion() -> "1.1.0".toVersion()
|
||||||
|
@ -256,8 +256,6 @@ data class Server(
|
||||||
/**
|
/**
|
||||||
* Capabilities that can be determined directly from the server's version, without checking
|
* Capabilities that can be determined directly from the server's version, without checking
|
||||||
* the instanceInfo response.
|
* the instanceInfo response.
|
||||||
*
|
|
||||||
* Modifies `capabilities` by potentially adding new capabilities to the map.
|
|
||||||
*/
|
*/
|
||||||
private fun capabilitiesFromServerVersion(kind: ServerKind, v: Version): MutableMap<ServerOperation, Version> {
|
private fun capabilitiesFromServerVersion(kind: ServerKind, v: Version): MutableMap<ServerOperation, Version> {
|
||||||
val c = mutableMapOf<ServerOperation, Version>()
|
val c = mutableMapOf<ServerOperation, Version>()
|
||||||
|
|
Loading…
Reference in New Issue