mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Introduce the RoomThreadListServiceProxy and expose it from the RoomProxy
Also update the sdk and app mocks and add a simple `RoomThreadListServiceProxyMock` # Conflicts: # ElementX.xcodeproj/project.pbxproj # ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # SDKMocks/Sources/Generated/SDKGeneratedMocks.swift # project.yml
This commit is contained in:
committed by
Stefan Ceriu
parent
823e2afa97
commit
e97ed6ec5c
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
// sourcery: AutoMockable
|
||||
protocol RoomThreadListServiceProxyProtocol {
|
||||
var itemsPublisher: CurrentValuePublisher<[RoomThreadListItem], Never> { get }
|
||||
|
||||
var paginationStatePublisher: CurrentValuePublisher<RoomThreadListPaginationState, Never> { get }
|
||||
|
||||
func paginate() async -> Result<Void, RoomProxyError>
|
||||
}
|
||||
|
||||
struct RoomThreadListItem: Identifiable {
|
||||
struct MessageDetails {
|
||||
let sender: TimelineItemSender
|
||||
let timestamp: Date
|
||||
let message: AttributedString?
|
||||
}
|
||||
|
||||
let id: String
|
||||
|
||||
let rootMessageDetails: MessageDetails
|
||||
let latestMessageDetails: MessageDetails?
|
||||
|
||||
let numberOfReplies: UInt
|
||||
}
|
||||
|
||||
enum RoomThreadListPaginationState: Equatable {
|
||||
case idle(endReached: Bool)
|
||||
case loading
|
||||
}
|
||||
Reference in New Issue
Block a user