mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Enable the sliding sync timeline api. Start observing updates coming through the TimelineListener before addining a timeline listener on the Rust side
This commit is contained in:
committed by
Stefan Ceriu
parent
77d62b2c72
commit
cc51795bf0
@@ -36,11 +36,10 @@ class RoomProxy: RoomProxyProtocol {
|
||||
|
||||
private var backPaginationOutcome: PaginationOutcome?
|
||||
|
||||
private var timelineObservationToken: StoppableSpawn?
|
||||
|
||||
deinit {
|
||||
room.removeTimeline()
|
||||
|
||||
#warning("We **should** use the slidingSyncRoom but it's not working properly yet")
|
||||
// slidingSyncRoom.removeTimeline()
|
||||
timelineObservationToken?.cancel()
|
||||
}
|
||||
|
||||
init(slidingSyncRoom: SlidingSyncRoomProtocol,
|
||||
@@ -131,15 +130,12 @@ class RoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
|
||||
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> {
|
||||
room.addTimelineListener(listener: listener)
|
||||
return .success(())
|
||||
|
||||
#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)
|
||||
// }
|
||||
if let token = slidingSyncRoom.addTimelineListener(listener: listener) {
|
||||
timelineObservationToken = token
|
||||
return .success(())
|
||||
} else {
|
||||
return .failure(.failedAddingTimelineListener)
|
||||
}
|
||||
}
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError> {
|
||||
|
||||
Reference in New Issue
Block a user