Handle API changes from Rust. (#506)

There are some bad assumptions about profile changes in here.

* Remove assumption FIXME's

Profile changes that come from other members will be state event of None.

* Bump SDK version.
This commit is contained in:
Doug
2023-01-31 13:28:28 +00:00
committed by GitHub
parent 17568a6a2e
commit 4f8cc08989
13 changed files with 87 additions and 64 deletions
@@ -50,9 +50,9 @@ enum TimelineItemProxy {
/// The delivery status for the item.
enum TimelineItemDeliveryStatus: Hashable {
case unknown
case sending
case sent(elapsedTime: TimeInterval)
case sendingFailed
}
/// A light wrapper around event timeline items returned from Rust.
@@ -64,19 +64,18 @@ struct EventTimelineItemProxy: CustomDebugStringConvertible {
}
var id: String {
switch item.key() {
case .transactionId(let txnID):
return txnID
case .eventId(let eventID):
return eventID
}
item.uniqueIdentifier()
}
var deliveryStatus: TimelineItemDeliveryStatus {
switch item.key() {
case .transactionId:
var deliveryStatus: TimelineItemDeliveryStatus? {
guard let localSendState = item.localSendState() else { return nil }
switch localSendState {
case .notSendYet:
return .sending
case .eventId:
case .sendingFailed:
return .sendingFailed
case .sent:
return .sent(elapsedTime: Date().timeIntervalSince1970 - timestamp.timeIntervalSince1970)
}
}
@@ -113,7 +112,7 @@ struct EventTimelineItemProxy: CustomDebugStringConvertible {
}
var reactions: [Reaction] {
item.reactions()
item.reactions() ?? []
}
var timestamp: Date {