diff --git a/src/rooms/SpaceListContextMenu.qml b/src/rooms/SpaceListContextMenu.qml index 71d96bba2..02afe3145 100644 --- a/src/rooms/SpaceListContextMenu.qml +++ b/src/rooms/SpaceListContextMenu.qml @@ -81,6 +81,28 @@ KirigamiComponents.ConvergentContextMenu { separator: true } + Kirigami.Action { + text: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report…") + icon.name: "dialog-warning-symbolic" + visible: root.connection.supportsMatrixSpecVersion("v1.13") + onTriggered: { + let dialog = (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ReasonDialog'), { + title: i18nc("@title:dialog", "Report Space"), + placeholder: i18nc("@info:placeholder", "Optionally give a reason for reporting this space"), + icon: "dialog-warning-symbolic", + actionText: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report"), + reporting: true, + connection: root.connection, + }, { + title: i18nc("@title", "Report Space"), + width: Kirigami.Units.gridUnit * 25 + }) as ReasonDialog; + dialog.accepted.connect(reason => { + root.room.report(reason); + }); + } + } + QQC2.Action { text: i18nc("'Space' is a matrix space", "Leave Space…") icon.name: "go-previous" diff --git a/src/spaces/SpaceHomePage.qml b/src/spaces/SpaceHomePage.qml index 2d1f8a0e9..027b148e1 100644 --- a/src/spaces/SpaceHomePage.qml +++ b/src/spaces/SpaceHomePage.qml @@ -105,6 +105,27 @@ ColumnLayout { Item { Layout.fillWidth: true } + QQC2.Button { + text: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report…") + icon.name: "dialog-warning-symbolic" + visible: root.connection.supportsMatrixSpecVersion("v1.13") + onClicked: { + let dialog = (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ReasonDialog'), { + title: i18nc("@title:dialog", "Report Space"), + placeholder: i18nc("@info:placeholder", "Optionally give a reason for reporting this space"), + icon: "dialog-warning-symbolic", + actionText: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report"), + reporting: true, + connection: root.room.connection, + }, { + title: i18nc("@title", "Report Space"), + width: Kirigami.Units.gridUnit * 25 + }) as ReasonDialog; + dialog.accepted.connect(reason => { + root.room.report(reason); + }); + } + } QQC2.Button { id: settingsButton