mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Simplify and fix implementation
This commit is contained in:
committed by
Stefan Ceriu
parent
f378e6e926
commit
30593909de
+17
-2
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user