Add banner for optional migration to simplified sliding sync (#3429)
* Add banner for optional migration to native sliding sync - Add `MatrixClient.isNativeSlidingSyncSupported()` and `MatrixClient.isUsingNativeSlidingSync` to check whether the home server supports native sliding sync and we're already using it. - Add `NativeSlidingSyncMigrationBanner` composable to the `RoomList` screen when the home server supports native sliding sync but the current session is not using it. - Add an extra logout successful action to the logout flow, create `EnableNativeSlidingSyncUseCase` so it can be used there. * Update screenshots * Make sure the sliding sync migration banner has lower priority than the encryption setup ones --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
7549d5f475
commit
67e262fdc8
32 changed files with 283 additions and 12 deletions
|
|
@ -93,6 +93,7 @@ import org.matrix.rustcomponents.sdk.IgnoredUsersListener
|
|||
import org.matrix.rustcomponents.sdk.NotificationProcessSetup
|
||||
import org.matrix.rustcomponents.sdk.PowerLevels
|
||||
import org.matrix.rustcomponents.sdk.SendQueueRoomErrorListener
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncVersion
|
||||
import org.matrix.rustcomponents.sdk.TaskHandle
|
||||
import org.matrix.rustcomponents.sdk.use
|
||||
import timber.log.Timber
|
||||
|
|
@ -528,6 +529,14 @@ class RustMatrixClient(
|
|||
})
|
||||
}.buffer(Channel.UNLIMITED)
|
||||
|
||||
override suspend fun isNativeSlidingSyncSupported(): Boolean {
|
||||
return client.availableSlidingSyncVersions().contains(SlidingSyncVersion.Native)
|
||||
}
|
||||
|
||||
override fun isUsingNativeSlidingSync(): Boolean {
|
||||
return client.session().slidingSyncVersion == SlidingSyncVersion.Native
|
||||
}
|
||||
|
||||
internal fun setDelegate(delegate: RustClientSessionDelegate) {
|
||||
client.setDelegate(delegate)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue