From 41de3c8fab9a62131b140499823b75b43e2e1a47 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 16 Sep 2022 15:06:02 +0200 Subject: [PATCH] disallow permabanned from seeing chat --- files/routes/chat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/files/routes/chat.py b/files/routes/chat.py index ffe513b4a..99dec99d2 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -33,7 +33,7 @@ messages = cache.get(f'{SITE}_chat') or [] total = cache.get(f'{SITE}_total') or 0 @app.get("/chat") -@auth_required +@is_not_permabanned def chat(v): return render_template("chat.html", v=v, messages=messages) @@ -47,7 +47,7 @@ def chatjs(): @socketio.on('speak') @limiter.limit("3/second;10/minute") @limiter.limit("3/second;10/minute", key_func=lambda:f'{SITE}-{session.get("lo_user")}') -@auth_required +@is_not_permabanned def speak(data, v): if v.is_banned: return '', 403 @@ -100,7 +100,7 @@ def speak(data, v): return '', 204 @socketio.on('connect') -@auth_required +@is_not_permabanned def connect(v): if v.username not in online: online.append(v.username) @@ -111,7 +111,7 @@ def connect(v): return '', 204 @socketio.on('disconnect') -@auth_required +@is_not_permabanned def disconnect(v): if v.username in online: online.remove(v.username) @@ -123,7 +123,7 @@ def disconnect(v): return '', 204 @socketio.on('typing') -@auth_required +@is_not_permabanned def typing_indicator(data, v): if data and v.username not in typing: typing.append(v.username)