diff --git a/files/helpers/const.py b/files/helpers/const.py index 026835f4a..fbc627876 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -145,6 +145,7 @@ HOLE_REQUIRED = False HOLE_COST = 0 HOLE_CREATE_JL_MIN = 0 HOLE_INACTIVITY_DELETION = False +PIN_ENABLED = True PIN_LIMIT = 3 POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day' LOGGEDIN_ACTIVE_TIME = 15 * 60 @@ -195,6 +196,8 @@ LOTTERY_DURATION = 60 * 60 * 24 * 7 if SITE in {'rdrama.net', 'devrama.xyz'}: HOLE_COST = 50000 HOLE_INACTIVITY_DELETION = True + PIN_ENABLED = False + NOTIFICATIONS_ID = 1046 AUTOJANNY_ID = 2360 SNAPPY_ID = 261 diff --git a/files/routes/admin.py b/files/routes/admin.py index 9541afa63..71d6267b0 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1254,7 +1254,9 @@ def api_distinguish_post(post_id, v): @app.post("/sticky/") @admin_level_required(2) def sticky_post(post_id, v): - abort(403) + if not PIN_ENABLED: + abort(403) + post = get_post(post_id) if post and not post.stickied: pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count() diff --git a/files/routes/awards.py b/files/routes/awards.py index 501b30823..e28c8b74e 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -197,7 +197,8 @@ def award_thing(v, thing_type, id): if note: text += f" ({note})" notify_mod_action(v.id, text) elif kind == "pin": - abort(403) + if not PIN_ENABLED: + abort(403) if thing.stickied and thing.stickied_utc: thing.stickied_utc += 3600 else: @@ -271,7 +272,8 @@ def award_thing(v, thing_type, id): author.fish = True badge_grant(badge_id=90, user=author) elif kind == "progressivestack": - abort(403) + if not PIN_ENABLED: + abort(403) if author.progressivestack: author.progressivestack += 21600 else: author.progressivestack = int(time.time()) + 21600 badge_grant(user=author, badge_id=94) diff --git a/files/routes/comments.py b/files/routes/comments.py index d5f086300..f2cfe3324 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -836,7 +836,8 @@ def undelete_comment(cid, v): @app.post("/pin_comment/") @auth_required def pin_comment(cid, v): - abort(403) + if not PIN_ENABLED: + abort(403) comment = get_comment(cid, v=v) if not comment.stickied: @@ -879,7 +880,8 @@ def unpin_comment(cid, v): @app.post("/mod_pin/") @auth_required def mod_pin(cid, v): - abort(403) + if not PIN_ENABLED: + abort(403) comment = get_comment(cid, v=v) if not comment.stickied: diff --git a/files/routes/posts.py b/files/routes/posts.py index 58ae602c0..77671eaa0 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1187,9 +1187,9 @@ def submit_post(v, sub=None): if body.startswith('!slots'): check_for_slots_command(body, snappy, c) - # if body.startswith(':#marseypin:') or body.startswith(':#marseypin2:'): - # post.stickied = "Snappy" - # post.stickied_utc = int(time.time()) + 3600 + if PIN_ENABLED and (body.startswith(':#marseypin:') or body.startswith(':#marseypin2:')): + post.stickied = "Snappy" + post.stickied_utc = int(time.time()) + 3600 g.db.flush()