2020-03-27 07:31:57 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import "../Base"
|
|
|
|
|
|
|
|
BoxPopup {
|
|
|
|
summary.text:
|
|
|
|
eventIds.length > 1 ?
|
|
|
|
qsTr("Remove selected messages?") :
|
|
|
|
qsTr("Remove selected message?")
|
|
|
|
|
2020-04-02 04:33:19 +11:00
|
|
|
details.color: theme.colors.warningText
|
2020-04-02 06:15:49 +11:00
|
|
|
details.text:
|
|
|
|
onlyOwnMessageWarning ?
|
|
|
|
qsTr("Only your messages will be removed") :
|
|
|
|
""
|
2020-04-02 04:33:19 +11:00
|
|
|
|
2020-03-27 07:31:57 +11:00
|
|
|
HLabeledTextField {
|
|
|
|
id: reasonField
|
|
|
|
label.text: qsTr("Reason (optional):")
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
okText: qsTr("Remove")
|
|
|
|
box.focusButton: "ok"
|
|
|
|
|
|
|
|
onOk: py.callClientCoro(
|
|
|
|
userId,
|
|
|
|
"room_mass_redact",
|
|
|
|
[roomId, reasonField.field.text, ...eventIds]
|
|
|
|
)
|
|
|
|
|
|
|
|
property string roomId: ""
|
|
|
|
property string userId: ""
|
|
|
|
|
|
|
|
property var eventIds: []
|
2020-04-02 06:15:49 +11:00
|
|
|
property bool onlyOwnMessageWarning: false
|
2020-03-27 07:31:57 +11:00
|
|
|
}
|