implemented navigation for permalinks to threads

also this handles the case where we are permalinking to non existent (or impossible to fetch) event.
This commit is contained in:
Mauro Romito
2025-10-01 13:18:53 +02:00
committed by Mauro
parent cf5a72bc10
commit 0288ce6b4b
6 changed files with 100 additions and 47 deletions
@@ -190,10 +190,10 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
}
}
func getThreadRootEventID(for eventID: String) async -> Result<String?, RoomProxyError> {
func loadOrFetchEvent(for eventID: String) async -> Result<TimelineEvent, RoomProxyError> {
do {
let event = try await room.loadOrFetchEvent(eventId: eventID)
return .success(event.threadRootEventId())
return .success(event)
} catch {
MXLog.error("Failed fetching the event with id: \(eventID) with error: \(error)")
return .failure(.sdkError(error))
@@ -97,7 +97,7 @@ protocol JoinedRoomProxyProtocol: RoomProxyProtocol {
func threadTimeline(eventID: String) async -> Result<TimelineProxyProtocol, RoomProxyError>
func getThreadRootEventID(for eventID: String) async -> Result<String?, RoomProxyError>
func loadOrFetchEvent(for eventID: String) async -> Result<TimelineEvent, RoomProxyError>
func messageFilteredTimeline(focus: TimelineFocus,
allowedMessageTypes: [TimelineAllowedMessageType],