mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add support for copying a caption. (#3563)
* Add timeline item action for copying a media caption. * Fix the action colours when long pressing a timeline item. Nice side effect: Reasonable sized buttons when button shapes are enabled. * Re-arrange the Timeline Item Menu. * Add timeline item menu snapshots for media items.
This commit is contained in:
+10
-6
@@ -35,18 +35,22 @@ extension EventBasedMessageTimelineItemProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
var hasMediaCaption: Bool {
|
||||
var mediaCaption: String? {
|
||||
switch contentType {
|
||||
case .audio(let content):
|
||||
content.caption != nil
|
||||
content.caption
|
||||
case .file(let content):
|
||||
content.caption != nil
|
||||
content.caption
|
||||
case .image(let content):
|
||||
content.caption != nil
|
||||
content.caption
|
||||
case .video(let content):
|
||||
content.caption != nil
|
||||
content.caption
|
||||
case .emote, .notice, .text, .location, .voice:
|
||||
false
|
||||
nil
|
||||
}
|
||||
}
|
||||
|
||||
var hasMediaCaption: Bool {
|
||||
mediaCaption != nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,4 +99,14 @@ extension EventBasedTimelineItemProtocol {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
var supportsMediaCaption: Bool {
|
||||
guard let messageBasedItem = self as? EventBasedMessageTimelineItemProtocol else { return false }
|
||||
return messageBasedItem.supportsMediaCaption
|
||||
}
|
||||
|
||||
var hasMediaCaption: Bool {
|
||||
guard let messageBasedItem = self as? EventBasedMessageTimelineItemProtocol else { return false }
|
||||
return messageBasedItem.hasMediaCaption
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user