Update the SDK and use media filename and caption internally. (#3375)

Doesn't render captions (other than in fallback places).
This commit is contained in:
Doug
2024-10-08 11:00:58 +01:00
committed by GitHub
parent 794d0eead1
commit 6e51969d27
42 changed files with 581 additions and 358 deletions
@@ -23,7 +23,7 @@ struct AudioRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
var properties = RoomTimelineItemProperties()
var body: String {
content.body
content.caption ?? content.filename
}
var contentType: EventBasedMessageTimelineItemContentType {
@@ -9,7 +9,11 @@ import UIKit
import UniformTypeIdentifiers
struct AudioRoomTimelineItemContent: Hashable {
let body: String
let filename: String
var caption: String?
var formattedCaption: AttributedString?
/// The original textual representation of the formatted caption directly from the event (usually HTML code)
var formattedCaptionHTMLString: String?
let duration: TimeInterval
let waveform: EstimatedWaveform?
let source: MediaSourceProxy?
@@ -26,7 +26,7 @@ struct FileRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
var properties = RoomTimelineItemProperties()
var body: String {
content.body
content.caption ?? content.filename
}
var contentType: EventBasedMessageTimelineItemContentType {
@@ -9,7 +9,11 @@ import Foundation
import UniformTypeIdentifiers
struct FileRoomTimelineItemContent: Hashable {
let body: String
let filename: String
var caption: String?
var formattedCaption: AttributedString?
/// The original textual representation of the formatted caption directly from the event (usually HTML code)
var formattedCaptionHTMLString: String?
let source: MediaSourceProxy?
let thumbnailSource: MediaSourceProxy?
let contentType: UTType?
@@ -25,7 +25,7 @@ struct ImageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
var properties = RoomTimelineItemProperties()
var body: String {
content.body
content.caption ?? content.filename
}
var contentType: EventBasedMessageTimelineItemContentType {
@@ -9,7 +9,11 @@ import Foundation
import UniformTypeIdentifiers
struct ImageRoomTimelineItemContent: Hashable {
let body: String
let filename: String
var caption: String?
var formattedCaption: AttributedString?
/// The original textual representation of the formatted caption directly from the event (usually HTML code)
var formattedCaptionHTMLString: String?
let source: MediaSourceProxy
let thumbnailSource: MediaSourceProxy?
var width: CGFloat?
@@ -25,7 +25,7 @@ struct VideoRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
var properties = RoomTimelineItemProperties()
var body: String {
content.body
content.caption ?? content.filename
}
var contentType: EventBasedMessageTimelineItemContentType {
@@ -9,7 +9,11 @@ import Foundation
import UniformTypeIdentifiers
struct VideoRoomTimelineItemContent: Hashable {
let body: String
let filename: String
var caption: String?
var formattedCaption: AttributedString?
/// The original textual representation of the formatted caption directly from the event (usually HTML code)
var formattedCaptionHTMLString: String?
let duration: TimeInterval
let source: MediaSourceProxy?
let thumbnailSource: MediaSourceProxy?
@@ -23,7 +23,7 @@ struct VoiceMessageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equa
var properties = RoomTimelineItemProperties()
var body: String {
content.body
content.caption ?? content.filename
}
var contentType: EventBasedMessageTimelineItemContentType {
@@ -63,7 +63,7 @@ struct VoiceMessageRoomTimelineView_Previews: PreviewProvider, TestablePreview {
canBeRepliedTo: true,
isThreaded: false,
sender: .init(id: "Bob"),
content: .init(body: "audio.ogg",
content: .init(filename: "audio.ogg",
duration: 300,
waveform: EstimatedWaveform.mockWaveform,
source: nil,