+// Delete a message.
+// We don't bother checking for permission because the button only appears if we have permission,
+// and even if someone hacks the client, the server will deny any unauthorized deletes.
+function forum_delete_message(message_div, message_number) {
+ if (confirm(_("Delete this message?")) == true) {
+ async_forum_delete_message = async() => {
+ response = await fetch(
+ "/ctdl/r/" + escapeHTMLURI(current_room) + "/" + message_number,
+ { method: "DELETE" }
+ );
+ if (response.ok) { // If the server accepted the delete, blank out the message div.
+ document.getElementById(message_div).outerHTML = "";
+ }
+ }
+ async_forum_delete_message();
+ }
+}
+