mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 04:18:31 +00:00
Remove ‘copy’ action for "media like" types (#1889)
* Remove ‘copy’ action when useless * Delete unused property
This commit is contained in:
@@ -558,7 +558,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
actions.append(.edit)
|
actions.append(.edit)
|
||||||
}
|
}
|
||||||
|
|
||||||
if item.isMessage, !item.isLocation {
|
if item.isCopyable {
|
||||||
actions.append(.copy)
|
actions.append(.copy)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-8
@@ -43,14 +43,6 @@ extension EventBasedTimelineItemProtocol {
|
|||||||
properties.deliveryStatus == .sendingFailed
|
properties.deliveryStatus == .sendingFailed
|
||||||
}
|
}
|
||||||
|
|
||||||
var isMessage: Bool {
|
|
||||||
self is EventBasedMessageTimelineItemProtocol
|
|
||||||
}
|
|
||||||
|
|
||||||
var isLocation: Bool {
|
|
||||||
self is LocationRoomTimelineItem
|
|
||||||
}
|
|
||||||
|
|
||||||
var pollIfAvailable: Poll? {
|
var pollIfAvailable: Poll? {
|
||||||
(self as? PollRoomTimelineItem)?.poll
|
(self as? PollRoomTimelineItem)?.poll
|
||||||
}
|
}
|
||||||
@@ -89,4 +81,17 @@ extension EventBasedTimelineItemProtocol {
|
|||||||
}
|
}
|
||||||
return start + timestamp
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user