mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
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:
+1
-1
@@ -23,7 +23,7 @@ struct AudioRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
|
||||
var properties = RoomTimelineItemProperties()
|
||||
|
||||
var body: String {
|
||||
content.body
|
||||
content.caption ?? content.filename
|
||||
}
|
||||
|
||||
var contentType: EventBasedMessageTimelineItemContentType {
|
||||
|
||||
+5
-1
@@ -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?
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ struct FileRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
|
||||
var properties = RoomTimelineItemProperties()
|
||||
|
||||
var body: String {
|
||||
content.body
|
||||
content.caption ?? content.filename
|
||||
}
|
||||
|
||||
var contentType: EventBasedMessageTimelineItemContentType {
|
||||
|
||||
+5
-1
@@ -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?
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ struct ImageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
|
||||
var properties = RoomTimelineItemProperties()
|
||||
|
||||
var body: String {
|
||||
content.body
|
||||
content.caption ?? content.filename
|
||||
}
|
||||
|
||||
var contentType: EventBasedMessageTimelineItemContentType {
|
||||
|
||||
+5
-1
@@ -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?
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ struct VideoRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable {
|
||||
var properties = RoomTimelineItemProperties()
|
||||
|
||||
var body: String {
|
||||
content.body
|
||||
content.caption ?? content.filename
|
||||
}
|
||||
|
||||
var contentType: EventBasedMessageTimelineItemContentType {
|
||||
|
||||
+5
-1
@@ -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?
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ struct VoiceMessageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equa
|
||||
var properties = RoomTimelineItemProperties()
|
||||
|
||||
var body: String {
|
||||
content.body
|
||||
content.caption ?? content.filename
|
||||
}
|
||||
|
||||
var contentType: EventBasedMessageTimelineItemContentType {
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user