From ce0d8279bb456e0b746725c033df146708ed85c3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 22 Jul 2021 13:00:18 +0200 Subject: [PATCH] sneed --- ruqqus/classes/comment.py | 1 + ruqqus/routes/comments.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ruqqus/classes/comment.py b/ruqqus/classes/comment.py index 6db8f25e5..aa9bf3f7c 100644 --- a/ruqqus/classes/comment.py +++ b/ruqqus/classes/comment.py @@ -38,6 +38,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): created_utc = Column(Integer, default=0) edited_utc = Column(Integer, default=0) is_banned = Column(Boolean, default=False) + shadowbanned = Column(Boolean, default=False) distinguish_level = Column(Integer, default=0) gm_distinguish = Column(Integer, ForeignKey("boards.id"), default=0) distinguished_board = relationship("Board", lazy="joined", primaryjoin="Comment.gm_distinguish==Board.id") diff --git a/ruqqus/routes/comments.py b/ruqqus/routes/comments.py index 937ed36c0..311a62885 100644 --- a/ruqqus/routes/comments.py +++ b/ruqqus/routes/comments.py @@ -360,6 +360,8 @@ def api_comment(v): if badlink: return jsonify({"error": f"Remove the following link and try again: `{check_url}`. Reason: {badlink.reason_text}"}), 403 + if v.shadowbanned: shadowbanned = True + else: shadowbanned = False # create comment c = Comment(author_id=v.id, parent_submission=parent_submission, @@ -371,7 +373,7 @@ def api_comment(v): original_board_id=parent_post.board_id, is_bot=is_bot, app_id=v.client.application.id if v.client else None, - creation_region=request.headers.get("cf-ipcountry") + shadowbanned=shadowbanned ) g.db.add(c)