diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 1305f7b62..16f1de03d 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -92,7 +92,8 @@ SUBMISSION_FLAIR_LENGTH_MAXIMUM: Final[int] = 350 SUBMISSION_TITLE_LENGTH_MAXIMUM: Final[int] = 500 SUBMISSION_URL_LENGTH_MAXIMUM: Final[int] = 2048 SUBMISSION_BODY_LENGTH_MAXIMUM: Final[int] = 20000 -COMMENT_BODY_LENGTH_MAXIMUM: Final[int] = 10000 +COMMENT_BODY_LENGTH_MAXIMUM: Final[int] = 500000 +COMMENT_BODY_LENGTH_MAXIMUM_UNFILTERED: Final[int] = 50000 MESSAGE_BODY_LENGTH_MAXIMUM: Final[int] = 10000 CSS_LENGTH_MAXIMUM: Final[int] = 4000 diff --git a/files/routes/comments.py b/files/routes/comments.py index 559167c8e..83a57ca3a 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -203,6 +203,10 @@ def api_comment(v): is_filtered = v.should_comments_be_filtered + if (v.admin_level <= PERMS['POST_COMMENT_MODERATION'] + and len(body) > COMMENT_BODY_LENGTH_MAXIMUM_UNFILTERED): + is_filtered = True + c = Comment(author_id=v.id, parent_submission=parent_post.id, parent_comment_id=parent_comment_id, @@ -241,6 +245,9 @@ def api_comment(v): if replying_to_blocked: message = "This user has blocked you. You are still welcome to reply " \ "but you will be held to a higher standard of civility than you would be otherwise" + elif (v.admin_level <= PERMS['POST_COMMENT_MODERATION'] + and len(body) > COMMENT_BODY_LENGTH_MAXIMUM_UNFILTERED): + message = "Your comment has been submitted but is a bit long, so it's pending approval." else: message = None return {"comment": render_template("comments.html", v=v, comments=[c], ajax=True, parent_level=level), "message": message}