Add support for the new RoomList API (#1092)

* Add support for the new RoomList API

Squashed commits:
[8c2625a] Re-enable invites
[339e59b5] Add automatic syncing restarts after entering the terminated state for whatever reason
[b5498e96] Reimplemented room list state management and usage
[8154b0cf] Fix visible rooms range setting after scrolling stops
[5155c44d] Hook up initial loading idicator and session verification banner to room list service states
[700a5a2e] Enable back room subscriptions, timeline listeners and unread notifications / counts
[9df383bc] Enable last messages and timestamps, they don't crash on release builds
[7c4da9da] Add back certain fields now that the "full room" is available
[9f6534a7] Adopt interfaces to new RoomList API, untested as requests don't go to the right URL

* Tweaks following code review

* Bump the RustSDK to v1.0.76-alpha
This commit is contained in:
Stefan Ceriu
2023-06-16 16:11:45 +03:00
committed by GitHub
parent de0213abb2
commit d2d626f724
25 changed files with 343 additions and 661 deletions
@@ -78,8 +78,8 @@ class InvitesScreenViewModelTests: XCTestCase {
private func setupViewModel(roomSummaries: [RoomSummary]? = nil) {
if let roomSummaries {
let summaryProvider = MockRoomSummaryProvider(state: .loaded(roomSummaries))
clientProxy.invitesSummaryProvider = summaryProvider
clientProxy.visibleRoomsSummaryProvider = summaryProvider
clientProxy.inviteSummaryProvider = summaryProvider
clientProxy.roomSummaryProvider = summaryProvider
}
viewModel = InvitesScreenViewModel(userSession: userSession)
+1 -1
View File
@@ -347,7 +347,7 @@ class LoggingTests: XCTestCase {
let pointer = Unmanaged.passRetained(NSURL(fileURLWithPath: "/tmp/file")).toOpaque()
let imageMessage = ImageMessageContent(body: "ImageString", source: MediaSource(unsafeFromRawPointer: pointer), info: nil)
let videoMessage = VideoMessageContent(body: "VideoString", source: MediaSource(unsafeFromRawPointer: pointer), info: nil)
let fileMessage = FileMessageContent(body: "FileString", source: MediaSource(unsafeFromRawPointer: pointer), info: nil)
let fileMessage = FileMessageContent(body: "FileString", filename: "FileName", source: MediaSource(unsafeFromRawPointer: pointer), info: nil)
// When logging that value
XCTAssert(MXLogger.logFiles.isEmpty)
@@ -37,7 +37,7 @@ final class MediaUploadingPreprocessorTests: XCTestCase {
XCTAssertEqual(audioURL.lastPathComponent, "test_audio.mp3")
XCTAssertEqual(audioInfo.mimetype, "audio/mpeg")
XCTAssertEqual(audioInfo.duration, 27252)
XCTAssertEqual(floor(audioInfo.duration ?? 0), 27252)
XCTAssertEqual(audioInfo.size, 764_176)
}
@@ -72,7 +72,7 @@ final class MediaUploadingPreprocessorTests: XCTestCase {
XCTAssertEqual(videoInfo.size, 1_431_959)
XCTAssertEqual(videoInfo.width, 1280)
XCTAssertEqual(videoInfo.height, 720)
XCTAssertEqual(videoInfo.duration, 30483)
XCTAssertEqual(floor(videoInfo.duration ?? 0), 30483)
XCTAssertNotNil(videoInfo.thumbnailInfo)
XCTAssertEqual(videoInfo.thumbnailInfo?.mimetype, "image/jpeg")