mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +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:
@@ -102,7 +102,13 @@ class TimelineInteractionHandler {
|
||||
case .copy:
|
||||
guard let messageTimelineItem = timelineItem as? EventBasedMessageTimelineItemProtocol else { return }
|
||||
UIPasteboard.general.string = messageTimelineItem.body
|
||||
case .edit:
|
||||
case .copyCaption:
|
||||
guard let messageTimelineItem = timelineItem as? EventBasedMessageTimelineItemProtocol,
|
||||
let caption = messageTimelineItem.mediaCaption else {
|
||||
return
|
||||
}
|
||||
UIPasteboard.general.string = caption
|
||||
case .edit, .addCaption, .editCaption, .editPoll:
|
||||
switch timelineItem {
|
||||
case let messageTimelineItem as EventBasedMessageTimelineItemProtocol:
|
||||
processEditMessageEvent(messageTimelineItem)
|
||||
@@ -115,13 +121,6 @@ class TimelineInteractionHandler {
|
||||
default:
|
||||
MXLog.error("Cannot edit item with id: \(timelineItem.id)")
|
||||
}
|
||||
case .addCaption, .editCaption:
|
||||
switch timelineItem {
|
||||
case let messageTimelineItem as EventBasedMessageTimelineItemProtocol:
|
||||
processEditMessageEvent(messageTimelineItem)
|
||||
default:
|
||||
MXLog.error("Cannot add/edit caption on item with id: \(timelineItem.id)")
|
||||
}
|
||||
case .removeCaption:
|
||||
guard case let .event(_, eventOrTransactionID) = timelineItem.id else {
|
||||
MXLog.error("Failed removing caption, missing event ID")
|
||||
|
||||
Reference in New Issue
Block a user