api: add option to delete own comments

This commit is contained in:
Adhityaa Chandrasekar
2019-05-15 09:13:39 -07:00
parent 5228ff671a
commit 5faa727ef8
3 changed files with 61 additions and 12 deletions

View File

@@ -936,18 +936,20 @@
append(options, reply);
if (isModerator) {
if (parentHex === "root") {
append(options, sticky);
}
if (isModerator && parentHex === "root") {
append(options, sticky);
}
if (isModerator || comment.commenterHex === selfHex) {
append(options, remove);
if (comment.state !== "approved") {
append(options, approve);
}
} else {
if (stickyCommentHex === comment.commentHex) {
append(options, sticky);
}
}
if (isModerator && comment.state !== "approved") {
append(options, approve);
}
if (!isModerator && stickyCommentHex === comment.commentHex) {
append(options, sticky);
}
attrSet(options, "style", "width: " + ((options.childNodes.length+1)*32) + "px;");