- response = await fetch(
- "/ctdl/r/" + escapeHTMLURI(current_room) + "/" + m,
- {
- method: "MOVE",
- headers: { "Destination" : "/ctdl/r/_TRASH_" }
- },
- );
+
+ if (is_trash_folder) {
+ response = await fetch(
+ "/ctdl/r/" + escapeHTMLURI(current_room) + "/" + m,
+ {
+ method: "DELETE" // If this is the Trash folder, delete permanently
+ },
+ );
+ }
+ else {
+ response = await fetch(
+ "/ctdl/r/" + escapeHTMLURI(current_room) + "/" + m,
+ {
+ method: "MOVE", // Otherwise, move to the Trash folder
+ headers: { "Destination" : "/ctdl/r/_TRASH_" }
+ },
+ );
+ }
+