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:
Stefan Ceriu
2023-01-09 17:17:18 +02:00
committed by Stefan Ceriu
parent 956e92a9ac
commit d70a240869
59 changed files with 802 additions and 296 deletions
@@ -42,6 +42,13 @@ enum TimelineItemProxy {
}
}
/// The delivery status for the item.
enum TimelineItemDeliveryStatus: Hashable {
case unknown
case sending
case sent(elapsedTime: TimeInterval)
}
/// A light wrapper around event timeline items returned from Rust.
struct EventTimelineItemProxy: CustomDebugStringConvertible {
let item: MatrixRustSDK.EventTimelineItem
@@ -59,6 +66,15 @@ struct EventTimelineItemProxy: CustomDebugStringConvertible {
}
}
var deliveryStatus: TimelineItemDeliveryStatus {
switch item.key() {
case .transactionId:
return .sending
case .eventId:
return .sent(elapsedTime: Date().timeIntervalSince1970 - timestamp.timeIntervalSince1970)
}
}
var body: String? {
content.asMessage()?.body()
}
@@ -71,10 +87,6 @@ struct EventTimelineItemProxy: CustomDebugStringConvertible {
item.content()
}
var isRedacted: Bool {
content.isRedactedMessage()
}
var isOwn: Bool {
item.isOwn()
}