Allow a mailbox to be deleted immediately

Fixes #3875
This commit is contained in:
Francis Lachapelle
2016-11-08 10:26:55 -05:00
parent eb0917f42f
commit 7a628bac12
3 changed files with 103 additions and 47 deletions
+21 -1
View File
@@ -2515,11 +2515,31 @@ function onMenuDeleteFolder(event) {
showConfirmDialog(_("Confirmation"),
_("Do you really want to move this folder into the trash ?"),
function(event) {
triggerAjaxRequest(urlstr, folderOperationCallback, errorLabel);
triggerAjaxRequest(urlstr, deleteFolderCallback, errorLabel);
disposeDialog();
});
}
function deleteFolderCallback(http) {
if (http.readyState == 4 && isHttpStatus204(http.status)) {
folderOperationCallback(http);
}
else {
var errorLabel = http.callbackData;
showConfirmDialog(
_("Warning"),
_("The mailbox could not be moved to the trash folder. Would you like to delete it immediately?"),
// Yes -- Delete immediately
function() {
var folderID = document.menuTarget.getAttribute("dataname");
var url = URLForFolderID(folderID) + "/delete?withoutTrash=1";
triggerAjaxRequest(url, folderOperationCallback, errorLabel);
disposeDialog();
}
);
}
}
function onMenuMarkFolderRead(event) {
var folderID = document.menuTarget.getAttribute("dataname");
var urlstr = URLForFolderID(folderID) + "/markRead";