2019-09-09 23:24:45 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
|
|
|
|
BoxPopup {
|
2019-09-10 10:56:10 +10:00
|
|
|
id: popup
|
2019-12-14 08:11:01 +11:00
|
|
|
summary.text: qsTr("Leave <i>%1</i> and lose the history?").arg(roomName)
|
|
|
|
summary.textFormat: Text.StyledText
|
2019-09-09 23:24:45 +10:00
|
|
|
details.text: qsTr(
|
2019-09-10 02:35:19 +10:00
|
|
|
"You will not be able to see the messages you received in " +
|
|
|
|
"this room anymore.\n\n" +
|
|
|
|
|
2019-09-09 23:24:45 +10:00
|
|
|
"If all members forget the room, it will be removed from the servers."
|
|
|
|
)
|
|
|
|
|
|
|
|
okText: qsTr("Forget")
|
|
|
|
box.focusButton: "ok"
|
|
|
|
|
2019-09-10 10:56:10 +10:00
|
|
|
onOk: py.callClientCoro(userId, "room_forget", [roomId], () => {
|
2019-12-10 02:35:50 +11:00
|
|
|
if (window.uiState.page === "Chat/Chat.qml" &&
|
|
|
|
window.uiState.pageProperties.userId === userId &&
|
|
|
|
window.uiState.pageProperties.roomId === roomId)
|
2019-09-10 10:56:10 +10:00
|
|
|
{
|
|
|
|
pageLoader.showPage("Default")
|
|
|
|
Qt.callLater(popup.destroy)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
onCancel: canDestroy = true
|
|
|
|
onClosed: if (canDestroy) Qt.callLater(popup.destroy)
|
2019-09-09 23:24:45 +10:00
|
|
|
|
|
|
|
|
|
|
|
property string userId: ""
|
|
|
|
property string roomId: ""
|
|
|
|
property string roomName: ""
|
2019-09-10 10:56:10 +10:00
|
|
|
|
|
|
|
property bool canDestroy: false
|
2019-09-09 23:24:45 +10:00
|
|
|
}
|