mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -26,11 +26,9 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
let homeserver = ""
|
||||
let restorationToken: RestorationToken? = nil
|
||||
|
||||
var visibleRoomsSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
var roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
|
||||
var allRoomsSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
|
||||
var invitesSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
var inviteSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
|
||||
var avatarURLPublisher: AnyPublisher<URL?, Never> { Empty().eraseToAnyPublisher() }
|
||||
|
||||
@@ -38,7 +36,7 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
|
||||
internal init(userID: String, roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()) {
|
||||
self.userID = userID
|
||||
visibleRoomsSummaryProvider = roomSummaryProvider
|
||||
self.roomSummaryProvider = roomSummaryProvider
|
||||
}
|
||||
|
||||
func loadUserAvatarURL() async { }
|
||||
@@ -72,14 +70,14 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
return roomForIdentifierMocks[identifier]
|
||||
}
|
||||
|
||||
guard let room = visibleRoomsSummaryProvider?.roomListPublisher.value.first(where: { $0.id == identifier }) else {
|
||||
guard let room = roomSummaryProvider?.roomListPublisher.value.first(where: { $0.id == identifier }) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch room {
|
||||
case .empty:
|
||||
return RoomProxyMock(with: .init(displayName: "Empty room"))
|
||||
case .filled(let details), .invalidated(let details):
|
||||
case .filled(let details):
|
||||
return RoomProxyMock(with: .init(displayName: details.name))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user