mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Remove ‘copy’ action for "media like" types (#1889)
* Remove ‘copy’ action when useless * Delete unused property
This commit is contained in:
parent
2f0b5a42f5
commit
293834cf94
@ -558,7 +558,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
actions.append(.edit)
|
||||
}
|
||||
|
||||
if item.isMessage, !item.isLocation {
|
||||
if item.isCopyable {
|
||||
actions.append(.copy)
|
||||
}
|
||||
|
||||
|
@ -43,14 +43,6 @@ extension EventBasedTimelineItemProtocol {
|
||||
properties.deliveryStatus == .sendingFailed
|
||||
}
|
||||
|
||||
var isMessage: Bool {
|
||||
self is EventBasedMessageTimelineItemProtocol
|
||||
}
|
||||
|
||||
var isLocation: Bool {
|
||||
self is LocationRoomTimelineItem
|
||||
}
|
||||
|
||||
var pollIfAvailable: Poll? {
|
||||
(self as? PollRoomTimelineItem)?.poll
|
||||
}
|
||||
@ -89,4 +81,17 @@ extension EventBasedTimelineItemProtocol {
|
||||
}
|
||||
return start + timestamp
|
||||
}
|
||||
|
||||
var isCopyable: Bool {
|
||||
guard let messageBasedItem = self as? EventBasedMessageTimelineItemProtocol else {
|
||||
return false
|
||||
}
|
||||
|
||||
switch messageBasedItem.contentType {
|
||||
case .audio, .file, .image, .video, .location, .voice:
|
||||
return false
|
||||
case .text, .emote, .notice:
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user