Room list fixes (#431)

* Fixes #396 - Avoid duplicates in room list, cleanup logic throughout

* Re-enabled the allRoomsView with a hard 500 room limit and reduced the diffing collection time.

* Fixes #385, #411 - Filter out spaces, invites and tombstoned rooms from the room list

* Various tweaks following code review
This commit is contained in:
Stefan Ceriu
2023-01-10 17:34:42 +02:00
committed by GitHub
parent edc06bf662
commit 3d1266ca25
9 changed files with 151 additions and 107 deletions
@@ -16,6 +16,7 @@
import Combine
import Foundation
import MatrixRustSDK
enum RoomSummaryProviderState {
case cold
@@ -24,25 +25,18 @@ enum RoomSummaryProviderState {
case live
}
enum RoomSummary: Identifiable {
case empty(id: String)
enum RoomSummary {
case empty
case filled(details: RoomSummaryDetails)
case invalidated(details: RoomSummaryDetails)
var id: String {
var id: String? {
switch self {
case .empty(let id):
return id
case .filled(let summary):
return summary.id
}
}
var asFilled: RoomSummaryDetails? {
guard case let .filled(details) = self else {
case .empty:
return nil
case .invalidated(let details), .filled(let details):
return details.id
}
return details
}
}