Confirmation popup to clear messages
This commit is contained in:
16
src/qml/Chat/ClearMessagesPopup.qml
Normal file
16
src/qml/Chat/ClearMessagesPopup.qml
Normal 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: ""
|
||||
}
|
@@ -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},
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user