Simplify and fix implementation

This commit is contained in:
Stefan Ceriu
2026-04-15 13:57:51 +03:00
committed by Stefan Ceriu
parent f378e6e926
commit 30593909de
3 changed files with 47 additions and 53 deletions
@@ -34,6 +34,10 @@ extension EventBasedMessageTimelineItemProtocol {
}
}
var hasMediaCaption: Bool {
mediaCaption != nil
}
var mediaCaption: String? {
switch contentType {
case .audio(let content):
@@ -49,7 +53,18 @@ extension EventBasedMessageTimelineItemProtocol {
}
}
var hasMediaCaption: Bool {
mediaCaption != nil
var formattedMediaCaption: AttributedString? {
switch contentType {
case .audio(let content):
content.formattedCaption
case .file(let content):
content.formattedCaption
case .image(let content):
content.formattedCaption
case .video(let content):
content.formattedCaption
case .emote, .notice, .text, .location, .voice:
nil
}
}
}