fix: Support same capabilities on Glitch as Mastodon (#828)

The Glitch fork reports the same version number as stock Mastodon and is
supposed to have the same baseline capabilities as stock Mastodon at
that version number.
This commit is contained in:
Nik Clayton 2024-07-22 16:37:26 +02:00 committed by GitHub
parent c4bc7f81da
commit e063ae69e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -259,7 +259,9 @@ data class Server(
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>()
when (kind) { when (kind) {
MASTODON -> { // Glitch has the same version number as upstream Mastodon
GLITCH, MASTODON -> {
// Client filtering
when { when {
v >= "3.1.0".toVersion() -> c[ORG_JOINMASTODON_FILTERS_CLIENT] = "1.1.0".toVersion() v >= "3.1.0".toVersion() -> c[ORG_JOINMASTODON_FILTERS_CLIENT] = "1.1.0".toVersion()
v >= "2.4.3".toVersion() -> c[ORG_JOINMASTODON_FILTERS_CLIENT] = "1.0.0".toVersion() v >= "2.4.3".toVersion() -> c[ORG_JOINMASTODON_FILTERS_CLIENT] = "1.0.0".toVersion()
@ -292,7 +294,7 @@ data class Server(
// Everything else. Assume server side filtering and no translation. This may be an // Everything else. Assume server side filtering and no translation. This may be an
// incorrect assumption. // incorrect assumption.
AKKOMA, FEDIBIRD, FRIENDICA, GLITCH, HOMETOWN, ICESHRIMP, PIXELFED, PLEROMA, UNKNOWN -> { AKKOMA, FEDIBIRD, FRIENDICA, HOMETOWN, ICESHRIMP, PIXELFED, PLEROMA, UNKNOWN -> {
c[ORG_JOINMASTODON_FILTERS_SERVER] = "1.0.0".toVersion() c[ORG_JOINMASTODON_FILTERS_SERVER] = "1.0.0".toVersion()
} }
} }