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
@@ -16,6 +16,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
private let room: RoomProtocol
|
||||
private let appSettings: AppSettings
|
||||
private let analyticsService: AnalyticsService
|
||||
private let eventStringBuilder: RoomEventStringBuilder
|
||||
|
||||
// periphery:ignore - required for instance retention in the rust codebase
|
||||
private var roomInfoObservationToken: TaskHandle?
|
||||
@@ -78,11 +79,13 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
init(roomListService: RoomListServiceProtocol,
|
||||
room: RoomProtocol,
|
||||
appSettings: AppSettings,
|
||||
analyticsService: AnalyticsService) async throws {
|
||||
analyticsService: AnalyticsService,
|
||||
eventStringBuilder: RoomEventStringBuilder) async throws {
|
||||
self.roomListService = roomListService
|
||||
self.room = room
|
||||
self.appSettings = appSettings
|
||||
self.analyticsService = analyticsService
|
||||
self.eventStringBuilder = eventStringBuilder
|
||||
|
||||
infoSubject = try await .init(RoomInfoProxy(roomInfo: room.roomInfo()))
|
||||
|
||||
@@ -200,6 +203,10 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func threadListService() async -> RoomThreadListServiceProxyProtocol {
|
||||
await RoomThreadListProxy(threadListService: room.threadListService(), eventStringBuilder: eventStringBuilder)
|
||||
}
|
||||
|
||||
func loadOrFetchEventDetails(for eventID: String) async -> Result<TimelineEvent, RoomProxyError> {
|
||||
do {
|
||||
let event = try await room.loadOrFetchEvent(eventId: eventID)
|
||||
|
||||
Reference in New Issue
Block a user