diff --git a/files/routes/chat.py b/files/routes/chat.py index b333b90b1..52fc3ce48 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -44,15 +44,6 @@ online = { cache.set(CHAT_ONLINE_CACHE_KEY, len(online[f'{SITE_FULL}/chat']), timeout=0) -def is_not_banned_socketio(f): - def wrapper(*args, **kwargs): - v = get_logged_in_user() - if not v: return '', 401 - if v.is_suspended: return '', 403 - return make_response(f(*args, v=v, **kwargs)) - wrapper.__name__ = f.__name__ - return wrapper - def auth_required_socketio(f): def wrapper(*args, **kwargs): v = get_logged_in_user() @@ -62,6 +53,15 @@ def auth_required_socketio(f): wrapper.__name__ = f.__name__ return wrapper +def is_not_banned_socketio(f): + def wrapper(*args, **kwargs): + v = get_logged_in_user() + if not v: return '', 401 + if v.is_suspended: return '', 403 + return make_response(f(*args, v=v, **kwargs)) + wrapper.__name__ = f.__name__ + return wrapper + CHAT_ERROR_MESSAGE = f"To prevent spam, you'll need {TRUESCORE_CC_CHAT_MINIMUM} truescore (this is {TRUESCORE_CC_CHAT_MINIMUM} votes, either up or down, on any threads or comments you've made) in order to access chat. Sorry! I love you 💖" @app.get("/chat")