diff --git a/src/qml/Popups/ForgetRoomPopup.qml b/src/qml/Popups/ForgetRoomPopup.qml new file mode 100644 index 00000000..ee302588 --- /dev/null +++ b/src/qml/Popups/ForgetRoomPopup.qml @@ -0,0 +1,21 @@ +import QtQuick 2.12 + +BoxPopup { + summary.text: qsTr( + "You will leave the room and lose its messages. Forget %1?" + ).arg(roomName) + + details.text: qsTr( + "If all members forget the room, it will be removed from the servers." + ) + + okText: qsTr("Forget") + box.focusButton: "ok" + + onOk: py.callClientCoro(userId, "room_forget", [roomId]) + + + property string userId: "" + property string roomId: "" + property string roomName: "" +} diff --git a/src/qml/SidePane/RoomDelegate.qml b/src/qml/SidePane/RoomDelegate.qml index addf498a..b494c404 100644 --- a/src/qml/SidePane/RoomDelegate.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -124,8 +124,14 @@ HTileDelegate { icon.color: theme.colors.negativeBackground text: qsTr("Forget") - onTriggered: py.callClientCoro( - model.user_id, "room_forget", [model.data.room_id] + onTriggered: Utils.makePopup( + "Popups/ForgetRoomPopup.qml", + sidePane, + { + userId: model.user_id, + roomId: model.data.room_id, + roomName: model.data.display_name, + } ) } }