From 51c4469e8596fb77426c46a608d155bc7fd55fa3 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Thu, 30 May 2024 19:14:27 +0200 Subject: [PATCH] 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 --- .../network/src/main/kotlin/app/pachli/core/network/Server.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/network/src/main/kotlin/app/pachli/core/network/Server.kt b/core/network/src/main/kotlin/app/pachli/core/network/Server.kt index ad6687d90..35323d739 100644 --- a/core/network/src/main/kotlin/app/pachli/core/network/Server.kt +++ b/core/network/src/main/kotlin/app/pachli/core/network/Server.kt @@ -116,7 +116,7 @@ data class Server( val capabilities = capabilitiesFromServerVersion(serverKind, version) when (serverKind) { - MASTODON -> { + GLITCH, HOMETOWN, MASTODON -> { if (instanceV2.configuration.translation.enabled) { capabilities[ORG_JOINMASTODON_STATUSES_TRANSLATE] = when { 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 * the instanceInfo response. - * - * Modifies `capabilities` by potentially adding new capabilities to the map. */ private fun capabilitiesFromServerVersion(kind: ServerKind, v: Version): MutableMap { val c = mutableMapOf()