mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Bump the RustSDK to v1.0.67 (#3512)
* Bump the RustSDK to v1.0.67 * PR comments --------- Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
@@ -104,6 +104,10 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
func debugInfo(for itemID: TimelineItemIdentifier) -> TimelineItemDebugInfo {
|
||||
.init(model: "Mock debug description", originalJSON: nil, latestEditJSON: nil)
|
||||
}
|
||||
|
||||
func sendHandle(for itemID: TimelineItemIdentifier) -> SendHandleProxy? {
|
||||
nil
|
||||
}
|
||||
|
||||
func retryDecryption(for sessionID: String) async { }
|
||||
|
||||
|
||||
@@ -308,6 +308,21 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
return .init(model: "Unknown item", originalJSON: nil, latestEditJSON: nil)
|
||||
}
|
||||
|
||||
func sendHandle(for itemID: TimelineItemIdentifier) -> SendHandleProxy? {
|
||||
for timelineItemProxy in activeTimelineProvider.itemProxies {
|
||||
switch timelineItemProxy {
|
||||
case .event(let item):
|
||||
if item.id == itemID {
|
||||
return item.sendHandle.map { .init(itemID: itemID, underlyingHandle: $0) }
|
||||
}
|
||||
default:
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func retryDecryption(for sessionID: String) async {
|
||||
await activeTimeline.retryDecryption(for: sessionID)
|
||||
}
|
||||
|
||||
+2
@@ -68,6 +68,8 @@ protocol RoomTimelineControllerProtocol {
|
||||
|
||||
func debugInfo(for itemID: TimelineItemIdentifier) -> TimelineItemDebugInfo
|
||||
|
||||
func sendHandle(for itemID: TimelineItemIdentifier) -> SendHandleProxy?
|
||||
|
||||
func retryDecryption(for sessionID: String) async
|
||||
|
||||
func eventTimestamp(for itemID: TimelineItemIdentifier) -> Date?
|
||||
|
||||
@@ -135,6 +135,8 @@ class EventTimelineItemProxy {
|
||||
|
||||
lazy var shieldState = item.lazyProvider.getShields(strict: false)
|
||||
|
||||
lazy var sendHandle = item.lazyProvider.getSendHandle()
|
||||
|
||||
lazy var readReceipts = item.readReceipts
|
||||
}
|
||||
|
||||
@@ -179,6 +181,40 @@ struct TimelineItemDebugInfo: Identifiable, CustomStringConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
struct SendHandleProxy: Hashable {
|
||||
enum Error: Swift.Error {
|
||||
case sdkError(Swift.Error)
|
||||
}
|
||||
|
||||
let itemID: TimelineItemIdentifier
|
||||
let underlyingHandle: SendHandle
|
||||
|
||||
func resend() async -> Result<Void, Error> {
|
||||
do {
|
||||
try await underlyingHandle.tryResend()
|
||||
return .success(())
|
||||
} catch {
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Hashable
|
||||
|
||||
static func == (lhs: SendHandleProxy, rhs: SendHandleProxy) -> Bool {
|
||||
lhs.itemID == rhs.itemID
|
||||
}
|
||||
|
||||
func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(itemID)
|
||||
}
|
||||
|
||||
static var mock: SendHandleProxy {
|
||||
.init(itemID: .event(uniqueID: .init(id: UUID().uuidString),
|
||||
eventOrTransactionID: .eventId(eventId: UUID().uuidString)),
|
||||
underlyingHandle: .init(noPointer: .init()))
|
||||
}
|
||||
}
|
||||
|
||||
extension Receipt {
|
||||
var dateTimestamp: Date? {
|
||||
guard let timestamp else {
|
||||
|
||||
@@ -50,7 +50,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
return nil
|
||||
}
|
||||
return buildStateTimelineItem(for: eventItemProxy, state: content, isOutgoing: isOutgoing)
|
||||
case .roomMembership(userId: let userID, let displayName, change: let change):
|
||||
case .roomMembership(userId: let userID, let displayName, change: let change, _):
|
||||
if isDM, change == .joined, userID == self.userID {
|
||||
return nil
|
||||
}
|
||||
@@ -511,7 +511,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
duration: messageContent.audio?.duration ?? 0,
|
||||
waveform: waveform,
|
||||
source: MediaSourceProxy(source: messageContent.source, mimeType: messageContent.info?.mimetype),
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.body))
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.filename))
|
||||
}
|
||||
|
||||
private func buildImageTimelineItemContent(_ messageContent: ImageMessageContent) -> ImageRoomTimelineItemContent {
|
||||
@@ -537,7 +537,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
height: height,
|
||||
aspectRatio: aspectRatio,
|
||||
blurhash: messageContent.info?.blurhash,
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.body))
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.filename))
|
||||
}
|
||||
|
||||
private func buildVideoTimelineItemContent(_ messageContent: VideoMessageContent) -> VideoRoomTimelineItemContent {
|
||||
@@ -564,7 +564,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
height: height,
|
||||
aspectRatio: aspectRatio,
|
||||
blurhash: messageContent.info?.blurhash,
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.body))
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.filename))
|
||||
}
|
||||
|
||||
private func buildLocationTimelineItemContent(_ locationContent: LocationContent) -> LocationRoomTimelineItemContent {
|
||||
@@ -585,7 +585,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
formattedCaptionHTMLString: htmlCaption,
|
||||
source: MediaSourceProxy(source: messageContent.source, mimeType: messageContent.info?.mimetype),
|
||||
thumbnailSource: thumbnailSource,
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.body))
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.filename))
|
||||
}
|
||||
|
||||
private func buildNoticeTimelineItemContent(_ messageContent: NoticeMessageContent) -> NoticeRoomTimelineItemContent {
|
||||
|
||||
Reference in New Issue
Block a user