From dd912addd1b8f23944b06b5d5dbdd955830ab40d Mon Sep 17 00:00:00 2001 From: TLSM Date: Sun, 13 Nov 2022 06:43:08 -0500 Subject: [PATCH] chat: allow dev envs, clarify error message. --- files/helpers/const.py | 10 +++++----- files/routes/chat.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index a5d33e5d9..24627b670 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -377,7 +377,7 @@ TRANSFER_MESSAGE_LENGTH_LIMIT = 200 # do not make larger than 10000 characters ( MIN_REPOST_CHECK_URL_LENGTH = 9 # also change the constant in checkRepost() of submit.js TRUESCORE_DONATE_LIMIT = 100 COSMETIC_AWARD_COIN_AWARD_PCT = 0.10 - +TRUESCORE_CHAT_LIMIT = 0 LOGGEDIN_ACTIVE_TIME = 15 * 60 PFP_DEFAULT_MARSEY = True @@ -462,8 +462,6 @@ TIERS_ID_TO_NAME = { 6: "Rich Bich" } -TRUESCORE_CHAT_LIMIT = 10 - if SITE == 'rdrama.net': FEATURES['PRONOUNS'] = True FEATURES['HOUSES'] = True @@ -476,6 +474,8 @@ if SITE == 'rdrama.net': SNAPPY_THREAD = 37749 NOTIFICATION_THREAD = 6489 + TRUESCORE_CHAT_LIMIT = 10 + HOLE_COST = 50000 HOLE_INACTIVITY_DELETION = True @@ -523,8 +523,6 @@ elif SITE == 'pcmemes.net': HOLE_COST = 2000 - TRUESCORE_CHAT_LIMIT = 0 - AUTOJANNY_ID = 1046 SNAPPY_ID = 261 LONGPOSTBOT_ID = 1832 @@ -570,6 +568,8 @@ elif SITE == 'watchpeopledie.tv': SIDEBAR_THREAD = 5403 BANNER_THREAD = 9869 + TRUESCORE_CHAT_LIMIT = 10 + HOLE_NAME = 'flair' HOLE_STYLE_FLAIR = True HOLE_REQUIRED = True diff --git a/files/routes/chat.py b/files/routes/chat.py index 024042403..3537e8cda 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -39,7 +39,8 @@ user_ids_to_socket_ids = {} @app.get("/chat") @is_not_permabanned def chat(v): - if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT and not v.club_allowed: abort(403) + if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT and not v.club_allowed: + abort(403, f"Need at least {TRUESCORE_CHAT_LIMIT} truescore for access to chat.") return render_template("chat.html", v=v, messages=messages)