Refactor the JoinRoom screen to take advantage of newer APIs and support more joinRule/membership combinations (i.e. invite required, restricted, banned) (#3685)

- expose the full RoomPreview and RoomMembershipDetails through their own proxies
- implement standard mocks for all the different combinations
- converge on a single room info provider
- rebuild all the previews
- prioritise the preview data over the room one.
This commit is contained in:
Stefan Ceriu
2025-01-20 19:07:11 +02:00
committed by GitHub
parent f20847f62b
commit 8577f53613
48 changed files with 504 additions and 248 deletions
@@ -61,20 +61,6 @@ enum SessionVerificationState {
case unverified
}
struct RoomPreviewDetails {
let roomID: String
let name: String?
let canonicalAlias: String?
let topic: String?
let avatarURL: URL?
let memberCount: UInt
let isHistoryWorldReadable: Bool?
let isJoined: Bool
let isInvited: Bool
let isPublic: Bool
let canKnock: Bool
}
// sourcery: AutoMockable
protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
var actionsPublisher: AnyPublisher<ClientProxyAction, Never> { get }
@@ -154,7 +140,7 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
func roomForIdentifier(_ identifier: String) async -> RoomProxyType?
func roomPreviewForIdentifier(_ identifier: String, via: [String]) async -> Result<RoomPreviewDetails, ClientProxyError>
func roomPreviewForIdentifier(_ identifier: String, via: [String]) async -> Result<RoomPreviewProxyProtocol, ClientProxyError>
@discardableResult func loadUserDisplayName() async -> Result<Void, ClientProxyError>