Mark rooms as read on push and pop. (#462)

We don't have visibility into timeline item read status so can't do this continuously yet.

* Simplify RoomTimelineProvider's responsibilities.
This commit is contained in:
Doug
2023-01-18 15:14:03 +00:00
committed by GitHub
parent 6615116226
commit 5017ba7122
14 changed files with 183 additions and 226 deletions
@@ -37,30 +37,36 @@ enum RoomTimelineControllerError: Error {
@MainActor
protocol RoomTimelineControllerProtocol {
var roomId: String { get }
var roomID: String { get }
var timelineItems: [RoomTimelineItemProtocol] { get }
var callbacks: PassthroughSubject<RoomTimelineControllerCallback, Never> { get }
func processItemAppearance(_ itemId: String) async
func processItemAppearance(_ itemID: String) async
func processItemDisappearance(_ itemId: String) async
func processItemDisappearance(_ itemID: String) async
func processItemTap(_ itemId: String) async -> RoomTimelineControllerAction
func processItemTap(_ itemID: String) async -> RoomTimelineControllerAction
func paginateBackwards(requestSize: UInt, untilNumberOfItems: UInt) async -> Result<Void, RoomTimelineControllerError>
func sendMessage(_ message: String) async
func markRoomAsRead() async -> Result<Void, RoomTimelineControllerError>
func sendReply(_ message: String, to itemId: String) async
func sendMessage(_ message: String, inReplyTo itemID: String?) async
func editMessage(_ newMessage: String, of itemId: String) async
func editMessage(_ newMessage: String, original itemID: String) async
func sendReaction(_ reaction: String, for itemId: String) async
func sendReaction(_ reaction: String, to itemID: String) async
func redact(_ eventID: String) async
func redact(_ itemID: String) async
func debugDescriptionFor(_ itemId: String) -> String
func debugDescription(for itemID: String) -> String
func retryDecryption(forSessionId sessionId: String) async
func retryDecryption(for sessionID: String) async
}
extension RoomTimelineControllerProtocol {
func sendMessage(_ message: String) async {
await sendMessage(message, inReplyTo: nil)
}
}