forked from MarseyWorld/MarseyWorld
chat: impose truescore chat limit
parent
bf98444ead
commit
681d8b482a
|
@ -462,6 +462,8 @@ TIERS_ID_TO_NAME = {
|
|||
6: "Rich Bich"
|
||||
}
|
||||
|
||||
TRUESCORE_CHAT_LIMIT = 10
|
||||
|
||||
if SITE == 'rdrama.net':
|
||||
FEATURES['PRONOUNS'] = True
|
||||
FEATURES['HOUSES'] = True
|
||||
|
@ -521,6 +523,8 @@ elif SITE == 'pcmemes.net':
|
|||
|
||||
HOLE_COST = 2000
|
||||
|
||||
TRUESCORE_CHAT_LIMIT = 0
|
||||
|
||||
AUTOJANNY_ID = 1046
|
||||
SNAPPY_ID = 261
|
||||
LONGPOSTBOT_ID = 1832
|
||||
|
|
|
@ -39,15 +39,17 @@ user_ids_to_socket_ids = {}
|
|||
@app.get("/chat")
|
||||
@is_not_permabanned
|
||||
def chat(v):
|
||||
if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT: abort(403)
|
||||
return render_template("chat.html", v=v, messages=messages)
|
||||
|
||||
|
||||
@socketio.on('speak')
|
||||
@limiter.limit("3/second;10/minute")
|
||||
@limiter.limit("3/second;10/minute", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
|
||||
@is_not_permabanned
|
||||
@ratelimit_user("3/second;10/minute")
|
||||
def speak(data, v):
|
||||
if v.is_banned: return '', 403
|
||||
if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT: return '', 403
|
||||
|
||||
vname = v.username.lower()
|
||||
if vname in muted:
|
||||
|
|
Loading…
Reference in New Issue