Add redaction menu (disabled).

This commit is contained in:
Doug
2022-09-14 09:40:00 +01:00
parent 4660f096f8
commit bd4a698f8b
12 changed files with 78 additions and 10 deletions
@@ -116,7 +116,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) {
@@ -137,6 +146,8 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
} catch {
displayError(.alert(ElementL10n.roomTimelinePermalinkCreationFailure))
}
case .redact:
redactItem(itemId)
}
}
@@ -148,4 +159,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
message: message)
}
}
private func redactItem(_ itemID: String) {
Task {
await timelineController.redactItem(itemID)
}
}
}