mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
#178: Add redaction menu (disabled).
This commit is contained in:
@@ -119,7 +119,16 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
return []
|
||||
}
|
||||
|
||||
return [.copy, .quote, .copyPermalink]
|
||||
let actions: [TimelineItemContextMenuAction] = [
|
||||
.copy, .quote, .copyPermalink
|
||||
]
|
||||
|
||||
#warning("Outgoing actions to be handled with the new Timeline API.")
|
||||
// if timelineItem.isOutgoing {
|
||||
// actions.append(.redact)
|
||||
// }
|
||||
|
||||
return actions
|
||||
}
|
||||
|
||||
private func processContentMenuAction(_ action: TimelineItemContextMenuAction, itemId: String) {
|
||||
@@ -140,6 +149,8 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
} catch {
|
||||
displayError(.alert(ElementL10n.roomTimelinePermalinkCreationFailure))
|
||||
}
|
||||
case .redact:
|
||||
redactItem(itemId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,4 +162,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
message: message)
|
||||
}
|
||||
}
|
||||
|
||||
private func redactItem(_ itemID: String) {
|
||||
Task {
|
||||
await timelineController.redactItem(itemID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user