mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Update the SDK (#3196)
* Update the SDK. * Fix API breaks on send failures and propagate the new type. * Handle new SDK ShieldState. * Set up the ClientBuilder's `cachePath` option. * Delete the cacheDirectory during logout/clearCache. * Add unit tests for RestorationToken decoding and SessionDirectories generation.
This commit is contained in:
@@ -68,7 +68,20 @@ enum TimelineItemProxy {
|
||||
enum TimelineItemDeliveryStatus: Hashable {
|
||||
case sending
|
||||
case sent
|
||||
case sendingFailed
|
||||
case sendingFailed(SendFailureReason)
|
||||
|
||||
enum SendFailureReason: Hashable {
|
||||
case verifiedUserHasUnsignedDevice(devices: [String: [String]])
|
||||
case verifiedUserChangedIdentity(users: [String])
|
||||
case unknown
|
||||
}
|
||||
|
||||
var isSendingFailed: Bool {
|
||||
switch self {
|
||||
case .sending, .sent: false
|
||||
case .sendingFailed: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A light wrapper around event timeline items returned from Rust.
|
||||
@@ -88,11 +101,15 @@ class EventTimelineItemProxy {
|
||||
|
||||
switch localSendState {
|
||||
case .sendingFailed(_, let isRecoverable):
|
||||
return isRecoverable ? .sending : .sendingFailed
|
||||
return isRecoverable ? .sending : .sendingFailed(.unknown)
|
||||
case .notSentYet:
|
||||
return .sending
|
||||
case .sent:
|
||||
return .sent
|
||||
case .verifiedUserHasUnsignedDevice(devices: let devices):
|
||||
return .sendingFailed(.verifiedUserHasUnsignedDevice(devices: devices))
|
||||
case .verifiedUserChangedIdentity(users: let users):
|
||||
return .sendingFailed(.verifiedUserChangedIdentity(users: users))
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user