mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
New timeline items (#424)
* Cleanup session verification state machine configuration * Add support for new timeline items: loading indicators, stickers and invalid/unsupported events * Add sticker accessibility label, fix session verification ones * Add support for the new TimelineStart timeline item and new pagination API. Remove identifiers from individual timeline items and only set them in the TimelineTableViewController * Add changelog
This commit is contained in:
committed by
Stefan Ceriu
parent
956e92a9ac
commit
d70a240869
@@ -55,7 +55,7 @@ struct MockRoomProxy: RoomProxyProtocol {
|
||||
.failure(.failedAddingTimelineListener)
|
||||
}
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError> {
|
||||
func paginateBackwards(requestSize: UInt, untilNumberOfItems: UInt) async -> Result<Void, RoomProxyError> {
|
||||
.failure(.failedPaginatingBackwards)
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ class RoomProxy: RoomProxyProtocol {
|
||||
|
||||
private(set) var displayName: String?
|
||||
|
||||
private var backPaginationOutcome: PaginationOutcome?
|
||||
|
||||
private var timelineObservationToken: StoppableSpawn?
|
||||
|
||||
deinit {
|
||||
@@ -138,17 +136,13 @@ class RoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError> {
|
||||
guard backPaginationOutcome?.moreMessages != false else {
|
||||
return .failure(.noMoreMessagesToBackPaginate)
|
||||
}
|
||||
|
||||
func paginateBackwards(requestSize: UInt, untilNumberOfItems: UInt) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
let outcome: PaginationOutcome = try await Task.dispatch(on: .global()) {
|
||||
try self.room.paginateBackwards(limit: UInt16(count))
|
||||
try await Task.dispatch(on: .global()) {
|
||||
try self.room.paginateBackwards(opts: .untilNumItems(eventLimit: UInt16(requestSize), items: UInt16(untilNumberOfItems)))
|
||||
}
|
||||
update(backPaginationOutcome: outcome)
|
||||
return .success(UInt(outcome.numUpdates))
|
||||
|
||||
return .success(())
|
||||
} catch {
|
||||
return .failure(.failedPaginatingBackwards)
|
||||
}
|
||||
@@ -255,8 +249,4 @@ class RoomProxy: RoomProxyProtocol {
|
||||
private func update(displayName: String) {
|
||||
self.displayName = displayName
|
||||
}
|
||||
|
||||
private func update(backPaginationOutcome: PaginationOutcome) {
|
||||
self.backPaginationOutcome = backPaginationOutcome
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ protocol RoomProxyProtocol {
|
||||
|
||||
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError>
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError>
|
||||
func paginateBackwards(requestSize: UInt, untilNumberOfItems: UInt) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func sendMessage(_ message: String, inReplyToEventId: String?) async -> Result<Void, RoomProxyError>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user