Merge pull request #5997 from vector-im/travis/spec/v1.3-edit/nothreads

Remove spec v1.3 check for threads
This commit is contained in:
Travis Ralston 2022-05-10 14:47:48 -06:00 committed by GitHub
commit 019ec6c1c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

1
changelog.d/5997.misc Normal file
View file

@ -0,0 +1 @@
Update check for server-side threads support to match spec.

View file

@ -74,8 +74,8 @@ internal fun Versions.isLoginAndRegistrationSupportedBySdk(): Boolean {
* Indicate if the homeserver support MSC3440 for threads * Indicate if the homeserver support MSC3440 for threads
*/ */
internal fun Versions.doesServerSupportThreads(): Boolean { internal fun Versions.doesServerSupportThreads(): Boolean {
return getMaxVersion() >= HomeServerVersion.v1_3_0 || // TODO: Check for v1.3 or whichever spec version formally specifies MSC3440.
unstableFeatures?.get(FEATURE_THREADS_MSC3440_STABLE) ?: false return unstableFeatures?.get(FEATURE_THREADS_MSC3440_STABLE) ?: false
} }
/** /**

View file

@ -62,12 +62,12 @@ class VersionsKtTest {
Versions(supportedVersions = listOf("r0.6.0")).doesServerSupportThreads() shouldBe false Versions(supportedVersions = listOf("r0.6.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("r0.9.1")).doesServerSupportThreads() shouldBe false Versions(supportedVersions = listOf("r0.9.1")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.2.0")).doesServerSupportThreads() shouldBe false Versions(supportedVersions = listOf("v1.2.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.3.0")).doesServerSupportThreads() shouldBe true Versions(supportedVersions = listOf("v1.3.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.3.1")).doesServerSupportThreads() shouldBe true Versions(supportedVersions = listOf("v1.3.1")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.5.1")).doesServerSupportThreads() shouldBe true Versions(supportedVersions = listOf("v1.5.1")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("r0.6.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to true)).doesServerSupportThreads() shouldBe true Versions(supportedVersions = listOf("r0.6.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to true)).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.2.1"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to true)).doesServerSupportThreads() shouldBe true Versions(supportedVersions = listOf("v1.2.1"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to true)).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("r0.6.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe false Versions(supportedVersions = listOf("r0.6.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.4.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe true Versions(supportedVersions = listOf("v1.4.0"), unstableFeatures = mapOf("org.matrix.msc3440.stable" to false)).doesServerSupportThreads() shouldBe false
} }
} }