master
Aevann1 2021-07-22 13:00:18 +02:00
parent cb97d2f746
commit ce0d8279bb
2 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
created_utc = Column(Integer, default=0) created_utc = Column(Integer, default=0)
edited_utc = Column(Integer, default=0) edited_utc = Column(Integer, default=0)
is_banned = Column(Boolean, default=False) is_banned = Column(Boolean, default=False)
shadowbanned = Column(Boolean, default=False)
distinguish_level = Column(Integer, default=0) distinguish_level = Column(Integer, default=0)
gm_distinguish = Column(Integer, ForeignKey("boards.id"), default=0) gm_distinguish = Column(Integer, ForeignKey("boards.id"), default=0)
distinguished_board = relationship("Board", lazy="joined", primaryjoin="Comment.gm_distinguish==Board.id") distinguished_board = relationship("Board", lazy="joined", primaryjoin="Comment.gm_distinguish==Board.id")

View File

@ -360,6 +360,8 @@ def api_comment(v):
if badlink: if badlink:
return jsonify({"error": f"Remove the following link and try again: `{check_url}`. Reason: {badlink.reason_text}"}), 403 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 # create comment
c = Comment(author_id=v.id, c = Comment(author_id=v.id,
parent_submission=parent_submission, parent_submission=parent_submission,
@ -371,7 +373,7 @@ def api_comment(v):
original_board_id=parent_post.board_id, original_board_id=parent_post.board_id,
is_bot=is_bot, is_bot=is_bot,
app_id=v.client.application.id if v.client else None, app_id=v.client.application.id if v.client else None,
creation_region=request.headers.get("cf-ipcountry") shadowbanned=shadowbanned
) )
g.db.add(c) g.db.add(c)