File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
Sources/StreamChatSwiftUI/ChatChannel/MessageList Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
99- Add participant actions in channel info view [ #982 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/982 )
1010- Add support for overriding ` onImageTap ` in ` LinkAttachmentView ` [ #986 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/986 )
1111- Add support for customizing text colors in ` LinkAttachmentView ` [ #992 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/992 )
12+ - Expose ` MediaAttachment ` properties and initializer [ #1000 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/1000 )
1213
1314### 🐞 Fixed
1415- Fix openChannel not working when searching or another chat shown [ #975 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/975 )
Original file line number Diff line number Diff line change @@ -425,9 +425,15 @@ extension ChatMessage {
425425public struct MediaAttachment : Identifiable , Equatable {
426426 @Injected ( \. utils) var utils
427427
428- let url : URL
429- let type : MediaAttachmentType
430- var uploadingState : AttachmentUploadingState ?
428+ public let url : URL
429+ public let type : MediaAttachmentType
430+ public var uploadingState : AttachmentUploadingState ?
431+
432+ public init ( url: URL , type: MediaAttachmentType , uploadingState: AttachmentUploadingState ? = nil ) {
433+ self . url = url
434+ self . type = type
435+ self . uploadingState = uploadingState
436+ }
431437
432438 public var id : String {
433439 url. absoluteString
@@ -477,9 +483,14 @@ extension MediaAttachment {
477483 }
478484}
479485
480- enum MediaAttachmentType {
481- case image
482- case video
486+ public struct MediaAttachmentType : RawRepresentable {
487+ public let rawValue : String
488+ public init ( rawValue: String ) {
489+ self . rawValue = rawValue
490+ }
491+
492+ public static let image = Self ( rawValue: " image " )
493+ public static let video = Self ( rawValue: " video " )
483494}
484495
485496/// Options for the gallery view.
You can’t perform that action at this time.
0 commit comments