When a message is deleted in a mailbox room, move it to Trash instead of deleting
authorArt Cancro <ajc@citadel.org>
Mon, 13 Mar 2023 17:20:17 +0000 (13:20 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 13 Mar 2023 17:20:17 +0000 (13:20 -0400)
webcit-ng/static/js/view_mail.js

index 3cfdb8ca39f04b649ef7b1a5efa6743bf555692d..0cbd527058b16c9bd4a93929705ff3837c3ab4a0 100644 (file)
@@ -20,7 +20,10 @@ mail_delete_func = async(table, row) => {
        let m = parseInt(row["id"].substring(12));      // derive msgnum from row id
        response = await fetch(
                "/ctdl/r/" + escapeHTMLURI(current_room) + "/" + m,
-               { method: "DELETE" }
+               {
+                       method: "MOVE",
+                       headers: { "Destination" : "/ctdl/r/_TRASH_" }
+               },
        );
        if (response.ok) {                              // If the server accepted the delete, blank out the message div.
                table.deleteRow(row.rowIndex);