Switch back to the old room instead of the slidingSyncRoom for dealing with the timeline

This commit is contained in:
Stefan Ceriu
2022-11-24 17:32:30 +02:00
committed by Stefan Ceriu
parent 0f7c1fc581
commit 1781f92882
+13 -6
View File
@@ -37,7 +37,10 @@ class RoomProxy: RoomProxyProtocol {
private var backPaginationOutcome: PaginationOutcome? private var backPaginationOutcome: PaginationOutcome?
deinit { deinit {
slidingSyncRoom.removeTimeline() room.removeTimeline()
#warning("We **should** use the slidingSyncRoom but it's not working properly yet")
// slidingSyncRoom.removeTimeline()
} }
init(slidingSyncRoom: SlidingSyncRoomProtocol, init(slidingSyncRoom: SlidingSyncRoomProtocol,
@@ -142,11 +145,15 @@ class RoomProxy: RoomProxyProtocol {
} }
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> { func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> {
if let result = slidingSyncRoom.addTimelineListener(listener: listener), result == true { room.addTimelineListener(listener: listener)
return .success(()) return .success(())
} else {
return .failure(.failedAddingTimelineListener) #warning("We **should** use the slidingSyncRoom but it's not working properly yet")
} // if let result = slidingSyncRoom.addTimelineListener(listener: listener), result == true {
// return .success(())
// } else {
// return .failure(.failedAddingTimelineListener)
// }
} }
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError> { func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError> {