Travis Ralston 2022-05-09 16:36:43 -06:00
parent 901e397409
commit c63a5c0201
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -62,9 +62,9 @@ class VersionsKtTest {
Versions(supportedVersions = listOf("r0.6.0")).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.3.0")).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.3.1")).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.5.1")).doesServerSupportThreads() shouldBe true
Versions(supportedVersions = listOf("v1.3.0")).doesServerSupportThreads() shouldBe false
Versions(supportedVersions = listOf("v1.3.1")).doesServerSupportThreads() shouldBe false
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("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