Skip to content

Commit de6b34d

Browse files
authored
Merge pull request #3609 from element-hq/feature/bma/slidingSyncCheck
Remove supportSlidingSync boolean.
2 parents b211941 + 0018cce commit de6b34d

17 files changed

+15
-99
lines changed

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProvider.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ data class AccountProvider(
1414
val isPublic: Boolean = false,
1515
val isMatrixOrg: Boolean = false,
1616
val isValid: Boolean = false,
17-
val supportSlidingSync: Boolean = false,
1817
)

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ open class AccountProviderProvider : PreviewParameterProvider<AccountProvider> {
1515
get() = sequenceOf(
1616
anAccountProvider(),
1717
anAccountProvider().copy(subtitle = null),
18-
anAccountProvider().copy(subtitle = null, title = "no.sliding.sync", supportSlidingSync = false),
19-
anAccountProvider().copy(subtitle = null, title = "invalid", isValid = false, supportSlidingSync = false),
18+
anAccountProvider().copy(subtitle = null, title = "invalid", isValid = false),
2019
anAccountProvider().copy(subtitle = null, title = "Other", isPublic = false, isMatrixOrg = false),
2120
// Add other state here
2221
)
@@ -28,5 +27,4 @@ fun anAccountProvider() = AccountProvider(
2827
isPublic = true,
2928
isMatrixOrg = true,
3029
isValid = true,
31-
supportSlidingSync = true,
3230
)

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/resolver/HomeserverData.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ data class HomeserverData(
1212
val homeserverUrl: String,
1313
// True if a wellknown file has been found and is valid. If false, it means that the [homeserverUrl] is valid
1414
val isWellknownValid: Boolean,
15-
// True if a wellknown file has been found and is valid and is claiming a sliding sync Url
16-
val supportSlidingSync: Boolean,
1715
)

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/resolver/HomeserverResolver.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class HomeserverResolver @Inject constructor(
2929
private val dispatchers: CoroutineDispatchers,
3030
private val wellknownRequest: WellknownRequest,
3131
) {
32-
suspend fun resolve(userInput: String): Flow<List<HomeserverData>> = flow {
32+
fun resolve(userInput: String): Flow<List<HomeserverData>> = flow {
3333
val flowContext = currentCoroutineContext()
3434
val trimmedUserInput = userInput.trim()
3535
if (trimmedUserInput.length < 4) return@flow
@@ -46,13 +46,11 @@ class HomeserverResolver @Inject constructor(
4646
}
4747
val isValid = wellKnown?.isValid().orFalse()
4848
if (isValid) {
49-
val supportSlidingSync = wellKnown?.supportSlidingSync().orFalse()
5049
// Emit the list as soon as possible
5150
currentList.add(
5251
HomeserverData(
5352
homeserverUrl = url,
5453
isWellknownValid = true,
55-
supportSlidingSync = supportSlidingSync
5654
)
5755
)
5856
withContext(flowContext) {
@@ -68,7 +66,6 @@ class HomeserverResolver @Inject constructor(
6866
HomeserverData(
6967
homeserverUrl = trimmedUserInput,
7068
isWellknownValid = false,
71-
supportSlidingSync = false,
7269
)
7370
)
7471
)

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/resolver/network/WellKnown.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ import kotlinx.serialization.Serializable
2121
* "m.identity_server": {
2222
* "base_url": "https://vector.im"
2323
* },
24-
* "org.matrix.msc3575.proxy": {
25-
* "url": "https://slidingsync.lab.matrix.org"
26-
* }
2724
* }
2825
* </pre>
2926
* .
@@ -34,14 +31,8 @@ data class WellKnown(
3431
val homeServer: WellKnownBaseConfig? = null,
3532
@SerialName("m.identity_server")
3633
val identityServer: WellKnownBaseConfig? = null,
37-
@SerialName("org.matrix.msc3575.proxy")
38-
val slidingSyncProxy: WellKnownSlidingSyncConfig? = null,
3934
) {
4035
fun isValid(): Boolean {
4136
return homeServer?.baseURL?.isNotBlank().orFalse()
4237
}
43-
44-
fun supportSlidingSync(): Boolean {
45-
return slidingSyncProxy?.url?.isNotBlank().orFalse()
46-
}
4738
}

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/resolver/network/WellKnownSlidingSyncConfig.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/changeaccountprovider/ChangeAccountProviderPresenter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class ChangeAccountProviderPresenter @Inject constructor(
2929
isPublic = true,
3030
isMatrixOrg = true,
3131
isValid = true,
32-
supportSlidingSync = true,
3332
)
3433
),
3534
changeServerState = changeServerState,

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/searchaccountprovider/SearchAccountProviderStateProvider.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,18 @@ fun aSearchAccountProviderState(
3434

3535
fun aHomeserverDataList(): List<HomeserverData> {
3636
return listOf(
37-
aHomeserverData(isWellknownValid = true, supportSlidingSync = true),
38-
aHomeserverData(homeserverUrl = "https://no.sliding.sync", isWellknownValid = true, supportSlidingSync = false),
39-
aHomeserverData(homeserverUrl = "https://invalid", isWellknownValid = false, supportSlidingSync = false),
37+
aHomeserverData(isWellknownValid = true),
38+
aHomeserverData(homeserverUrl = "https://no.sliding.sync", isWellknownValid = true),
39+
aHomeserverData(homeserverUrl = "https://invalid", isWellknownValid = false),
4040
)
4141
}
4242

4343
fun aHomeserverData(
4444
homeserverUrl: String = AuthenticationConfig.MATRIX_ORG_URL,
4545
isWellknownValid: Boolean = true,
46-
supportSlidingSync: Boolean = true,
4746
): HomeserverData {
4847
return HomeserverData(
4948
homeserverUrl = homeserverUrl,
5049
isWellknownValid = isWellknownValid,
51-
supportSlidingSync = supportSlidingSync,
5250
)
5351
}

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/searchaccountprovider/SearchAccountProviderView.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ private fun HomeserverData.toAccountProvider(): AccountProvider {
196196
isPublic = isMatrixOrg,
197197
isMatrixOrg = isMatrixOrg,
198198
isValid = isWellknownValid,
199-
supportSlidingSync = supportSlidingSync,
200199
)
201200
}
202201

features/login/impl/src/test/kotlin/io/element/android/features/login/impl/screens/changeaccountprovider/ChangeAccountProviderPresenterTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class ChangeAccountProviderPresenterTest {
4646
isPublic = true,
4747
isMatrixOrg = true,
4848
isValid = true,
49-
supportSlidingSync = true,
5049
)
5150
)
5251
)

0 commit comments

Comments
 (0)