* Make sure the logout doesn't cause a crash
Some reasons why this could happen:
1. The `ClientDelegate` could receive a `didReceiveAuthError` callback call on a logout, which could trigger another logout when every Rust object had already been destroyed.
2. Even though we stop the sync before logging out, `LoggedInFlowNode` will try to start it again automatically when it detects we still have internet connection.
Making sure to unregister the delegate should fix the first part of the issue.
For the other one, adding `RustSyncService.isServiceReady` to check if we should start/stop the service, which is enabled by default and set to false on destroy should help.
* Apply the same patch on account deactivation.
---------
Co-authored-by: Benoit Marty <benoit@matrix.org>
* Add `InvitedRoom` to wrap Rust SDK Rooms in 'invited' membership state.
At the moment, this is a wrapper that allows us to call `Room.leave()` without having to initialise the room's timeline (which is impossible).
* Add `MatrixRoom.getInvitedRoom(roomId)` to get one of these rooms.
Also, `RustRoomFactory` now has a `createInvitedRoom` method for this.
* Adapt `AcceptDeclineInvitePresenter` to use the new APIs.
* Add `MatrixClient.isSlidingSyncProxySupported` function
* Update localazy strings
* Modify `ErrorDialog` to have an `onSubmit` call, which will be used for the submit action.
Also make the title text optional and dismissing the dialog by tapping outside/going back configurable.
* Check if a forced migration to SSS is needed because the proxy is no longer available.
In that case, display the non-dismissable dialog and force the user to log out after enabling SSS.
* Enable native/simplified sliding sync by default.
* Refactor the login to make sure we:
1. Always try native/simplified sliding sync login first, if available.
2. Then, if it wasn't available or failed with an sliding sync not supported error, try with the proxy instead (either discovered proxy or forced custom one).
* Move logic to `LoggedInPresenter` and the UI to `LoggedInView`
* Update screenshots
---------
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
* 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>