Confirmation popup to clear messages

This commit is contained in:
miruka
2019-09-09 06:23:46 -04:00
parent f40e853078
commit 2611e86517
5 changed files with 77 additions and 8 deletions

View File

@@ -0,0 +1,16 @@
import QtQuick 2.12
import "../Base"
HOkCancelPopup {
text: qsTr(
"Clear this room's messages?\n" +
"The messages will only be removed on your side. " +
"They will be available again after you restart the application."
)
onOk: py.callClientCoro(userId, "clear_events", [roomId])
property string userId: ""
property string roomId: ""
}

View File

@@ -127,8 +127,10 @@ Column {
HMenuItem {
icon.name: "clear-messages"
text: qsTr("Clear messages")
onTriggered: py.callClientCoro(
chatPage.userId, "clear_events", [chatPage.roomId],
onTriggered: Utils.makePopup(
"Chat/ClearMessagesPopup.qml",
chatPage,
{userId: chatPage.userId, roomId: chatPage.roomId},
)
}