Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

FeatureAttachmentAssetResolving.swift

23 lines792 Bytes

1import Foundation
2​
3/// Visible attachment rows resolve their own URLs. Opening a thread does not
4/// request signed URLs for images that are still outside the viewport.
5@MainActor
6public protocol FeatureAttachmentAssetResolving: AnyObject {
7 func attachmentAssetURL(
8 threadID: String,
9 attachment: FeatureMessageAttachment
10 ) async throws -> URL
12​
13struct FeatureAttachmentContext: Equatable {
14 let threadID: String
15 let resolver: any FeatureAttachmentAssetResolving
16 var environmentID: String? = nil
17 var wireThreadID: String? = nil
18​
19 static func == (lhs: Self, rhs: Self) -> Bool {
20 lhs.threadID == rhs.threadID && lhs.resolver === rhs.resolver
21 && lhs.environmentID == rhs.environmentID && lhs.wireThreadID == rhs.wireThreadID
22 }