Add support for rendering media captions in the timeline. (#3429)

This commit is contained in:
Doug
2024-10-21 15:29:03 +01:00
committed by GitHub
parent 201e3b0c9c
commit a0c81cf393
13 changed files with 116 additions and 36 deletions
@@ -24,3 +24,20 @@ protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineItemProtocol {
var contentType: EventBasedMessageTimelineItemContentType { get }
var isThreaded: Bool { get }
}
extension EventBasedMessageTimelineItemProtocol {
var hasMediaCaption: Bool {
switch contentType {
case .audio(let content):
content.caption != nil
case .file(let content):
content.caption != nil
case .image(let content):
content.caption != nil
case .video(let content):
content.caption != nil
case .emote, .notice, .text, .location, .voice:
false
}
}
}