forked from rDrama/rDrama
Make pin disabling site-specific.
parent
42a6b5731a
commit
08c2ec7223
|
@ -145,6 +145,7 @@ HOLE_REQUIRED = False
|
||||||
HOLE_COST = 0
|
HOLE_COST = 0
|
||||||
HOLE_CREATE_JL_MIN = 0
|
HOLE_CREATE_JL_MIN = 0
|
||||||
HOLE_INACTIVITY_DELETION = False
|
HOLE_INACTIVITY_DELETION = False
|
||||||
|
PIN_ENABLED = True
|
||||||
PIN_LIMIT = 3
|
PIN_LIMIT = 3
|
||||||
POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day'
|
POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day'
|
||||||
LOGGEDIN_ACTIVE_TIME = 15 * 60
|
LOGGEDIN_ACTIVE_TIME = 15 * 60
|
||||||
|
@ -195,6 +196,8 @@ LOTTERY_DURATION = 60 * 60 * 24 * 7
|
||||||
if SITE in {'rdrama.net', 'devrama.xyz'}:
|
if SITE in {'rdrama.net', 'devrama.xyz'}:
|
||||||
HOLE_COST = 50000
|
HOLE_COST = 50000
|
||||||
HOLE_INACTIVITY_DELETION = True
|
HOLE_INACTIVITY_DELETION = True
|
||||||
|
PIN_ENABLED = False
|
||||||
|
|
||||||
NOTIFICATIONS_ID = 1046
|
NOTIFICATIONS_ID = 1046
|
||||||
AUTOJANNY_ID = 2360
|
AUTOJANNY_ID = 2360
|
||||||
SNAPPY_ID = 261
|
SNAPPY_ID = 261
|
||||||
|
|
|
@ -1254,7 +1254,9 @@ def api_distinguish_post(post_id, v):
|
||||||
@app.post("/sticky/<post_id>")
|
@app.post("/sticky/<post_id>")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
def sticky_post(post_id, v):
|
def sticky_post(post_id, v):
|
||||||
|
if not PIN_ENABLED:
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
post = get_post(post_id)
|
post = get_post(post_id)
|
||||||
if post and not post.stickied:
|
if post and not post.stickied:
|
||||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count()
|
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count()
|
||||||
|
|
|
@ -197,6 +197,7 @@ def award_thing(v, thing_type, id):
|
||||||
if note: text += f" ({note})"
|
if note: text += f" ({note})"
|
||||||
notify_mod_action(v.id, text)
|
notify_mod_action(v.id, text)
|
||||||
elif kind == "pin":
|
elif kind == "pin":
|
||||||
|
if not PIN_ENABLED:
|
||||||
abort(403)
|
abort(403)
|
||||||
if thing.stickied and thing.stickied_utc:
|
if thing.stickied and thing.stickied_utc:
|
||||||
thing.stickied_utc += 3600
|
thing.stickied_utc += 3600
|
||||||
|
@ -271,6 +272,7 @@ def award_thing(v, thing_type, id):
|
||||||
author.fish = True
|
author.fish = True
|
||||||
badge_grant(badge_id=90, user=author)
|
badge_grant(badge_id=90, user=author)
|
||||||
elif kind == "progressivestack":
|
elif kind == "progressivestack":
|
||||||
|
if not PIN_ENABLED:
|
||||||
abort(403)
|
abort(403)
|
||||||
if author.progressivestack: author.progressivestack += 21600
|
if author.progressivestack: author.progressivestack += 21600
|
||||||
else: author.progressivestack = int(time.time()) + 21600
|
else: author.progressivestack = int(time.time()) + 21600
|
||||||
|
|
|
@ -836,6 +836,7 @@ def undelete_comment(cid, v):
|
||||||
@app.post("/pin_comment/<cid>")
|
@app.post("/pin_comment/<cid>")
|
||||||
@auth_required
|
@auth_required
|
||||||
def pin_comment(cid, v):
|
def pin_comment(cid, v):
|
||||||
|
if not PIN_ENABLED:
|
||||||
abort(403)
|
abort(403)
|
||||||
comment = get_comment(cid, v=v)
|
comment = get_comment(cid, v=v)
|
||||||
|
|
||||||
|
@ -879,6 +880,7 @@ def unpin_comment(cid, v):
|
||||||
@app.post("/mod_pin/<cid>")
|
@app.post("/mod_pin/<cid>")
|
||||||
@auth_required
|
@auth_required
|
||||||
def mod_pin(cid, v):
|
def mod_pin(cid, v):
|
||||||
|
if not PIN_ENABLED:
|
||||||
abort(403)
|
abort(403)
|
||||||
comment = get_comment(cid, v=v)
|
comment = get_comment(cid, v=v)
|
||||||
|
|
||||||
|
|
|
@ -1187,9 +1187,9 @@ def submit_post(v, sub=None):
|
||||||
if body.startswith('!slots'):
|
if body.startswith('!slots'):
|
||||||
check_for_slots_command(body, snappy, c)
|
check_for_slots_command(body, snappy, c)
|
||||||
|
|
||||||
# if body.startswith(':#marseypin:') or body.startswith(':#marseypin2:'):
|
if PIN_ENABLED and (body.startswith(':#marseypin:') or body.startswith(':#marseypin2:')):
|
||||||
# post.stickied = "Snappy"
|
post.stickied = "Snappy"
|
||||||
# post.stickied_utc = int(time.time()) + 3600
|
post.stickied_utc = int(time.time()) + 3600
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue