Allow redaction of message only by admins and authors of the message

Previously you could click on the button but it would do nothing
This commit is contained in:
Carl Schwan
2020-12-05 11:29:37 +01:00
parent 064bc5adbe
commit 29584aec23
6 changed files with 12 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ import NeoChat.Effect 1.0
Control {
id: root
Layout.fillWidth: true
Audio {
@@ -32,7 +33,7 @@ Control {
Kirigami.Action {
id: saveFileAction
onTriggered: {
let contextMenu = fileDelegateContextMenu.createObject(root)
let contextMenu = fileDelegateContextMenu.createObject(root, {'room': currentRoom, 'author': author});
contextMenu.viewSource.connect(function() {
messagerSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
})

View File

@@ -61,7 +61,7 @@ RowLayout {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
var contextMenu = fileDelegateContextMenu.createObject(root)
var contextMenu = fileDelegateContextMenu.createObject(root, {'room': currentRoom, 'author': author});
contextMenu.viewSource.connect(function() {
messageSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
})

View File

@@ -93,7 +93,7 @@ Image {
onPrimaryClicked: fullScreenImage.createObject(parent, {"filename": eventId, "localPath": currentRoom.urlToDownload(eventId)}).showFullScreen()
onSecondaryClicked: {
var contextMenu = imageDelegateContextMenu.createObject(root)
var contextMenu = imageDelegateContextMenu.createObject(root, {'room': currentRoom});
contextMenu.viewSource.connect(function() {
messageSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
})

View File

@@ -172,7 +172,7 @@ Video {
}
onSecondaryClicked: {
var contextMenu = imageDelegateContextMenu.createObject(vid)
var contextMenu = imageDelegateContextMenu.createObject(vid, {'room': currentRoom, 'author': author})
contextMenu.viewSource.connect(function() {
messageSourceSheet.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
})