diff --git a/qml/delegates/Session.qml b/qml/delegates/Session.qml index d1e685760..b490688c7 100644 --- a/qml/delegates/Session.qml +++ b/qml/delegates/Session.qml @@ -108,8 +108,12 @@ ListItem { } } - function remove() { - console.log("Remove all messages") + function remove(contentItem) { + contentItem.remorseAction(qsTr("Deleting all messages"), + function() { + console.log("Deleting all messages for session: "+model.id) + whisperfish.deleteAllMessages(model.id) + }) } Component { @@ -119,7 +123,7 @@ ListItem { id: menu MenuItem { text: qsTr("Delete Conversation") - onClicked: remove() + onClicked: remove(menu.parent) } } } diff --git a/qml/pages/MessagesView.qml b/qml/pages/MessagesView.qml index f1863fe2b..363bed4ac 100644 --- a/qml/pages/MessagesView.qml +++ b/qml/pages/MessagesView.qml @@ -141,17 +141,6 @@ SilicaListView { }) } } - MenuItem { - text: qsTr("Delete All") - onClicked: { - remorse.execute(qsTr("Deleting All Messages"), - function() { - console.log("Deleting all messages for session: "+messageModel.sid) - whisperfish.deleteAllMessages(messageModel.sid) - mainWindow.showMainPage(PageStackAction.Immediate) - }) - } - } } VerticalScrollDecorator {}