fixed an issue where threads would not do the initial focus and an issue where the timeline did throw an error by mistake

This commit is contained in:
Mauro Romito
2025-10-08 18:19:13 +02:00
committed by Mauro
parent 0009259119
commit 40367eeec9
7 changed files with 34 additions and 34 deletions
@@ -21,15 +21,16 @@ struct TimelineControllerFactory: TimelineControllerFactoryProtocol {
appSettings: ServiceLocator.shared.settings)
}
func buildThreadTimelineController(eventID: String,
func buildThreadTimelineController(threadRootEventID: String,
initialFocussedEventID: String?,
roomProxy: JoinedRoomProxyProtocol,
timelineItemFactory: RoomTimelineItemFactoryProtocol,
mediaProvider: MediaProviderProtocol) async -> Result<TimelineControllerProtocol, TimelineFactoryControllerError> {
switch await roomProxy.threadTimeline(eventID: eventID) {
switch await roomProxy.threadTimeline(eventID: threadRootEventID) {
case .success(let timelineProxy):
return .success(TimelineController(roomProxy: roomProxy,
timelineProxy: timelineProxy,
initialFocussedEventID: nil,
initialFocussedEventID: initialFocussedEventID,
timelineItemFactory: timelineItemFactory,
mediaProvider: mediaProvider,
appSettings: ServiceLocator.shared.settings))
@@ -19,7 +19,8 @@ protocol TimelineControllerFactoryProtocol {
timelineItemFactory: RoomTimelineItemFactoryProtocol,
mediaProvider: MediaProviderProtocol) -> TimelineControllerProtocol
func buildThreadTimelineController(eventID: String,
func buildThreadTimelineController(threadRootEventID: String,
initialFocussedEventID: String?,
roomProxy: JoinedRoomProxyProtocol,
timelineItemFactory: RoomTimelineItemFactoryProtocol,
mediaProvider: MediaProviderProtocol) async -> Result<TimelineControllerProtocol, TimelineFactoryControllerError>
@@ -135,10 +135,8 @@ final class TimelineProxy: TimelineProxyProtocol {
}
// This extra check is necessary as detached timelines don't support subscribing to pagination status.
// We need it to make sure we send a valid status after a failure.
guard subject.value == .idle else {
MXLog.error("Attempting to paginate \(direction.rawValue) when already at the end.")
return .failure(.failedPaginatingEndReached)
return .success(())
}
MXLog.info("Paginating \(direction.rawValue)")
@@ -47,7 +47,6 @@ enum TimelineProxyError: Error {
case sdkError(Error)
case failedRedacting
case failedPaginatingEndReached
}
/// Element X proxies generally wrap the counterpart RustSDK objects while providing platform specific