forked from rDrama/rDrama
disallow permabanned from seeing chat
parent
0923460ea1
commit
41de3c8fab
|
@ -33,7 +33,7 @@ messages = cache.get(f'{SITE}_chat') or []
|
||||||
total = cache.get(f'{SITE}_total') or 0
|
total = cache.get(f'{SITE}_total') or 0
|
||||||
|
|
||||||
@app.get("/chat")
|
@app.get("/chat")
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def chat(v):
|
def chat(v):
|
||||||
return render_template("chat.html", v=v, messages=messages)
|
return render_template("chat.html", v=v, messages=messages)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ def chatjs():
|
||||||
@socketio.on('speak')
|
@socketio.on('speak')
|
||||||
@limiter.limit("3/second;10/minute")
|
@limiter.limit("3/second;10/minute")
|
||||||
@limiter.limit("3/second;10/minute", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
|
@limiter.limit("3/second;10/minute", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def speak(data, v):
|
def speak(data, v):
|
||||||
if v.is_banned: return '', 403
|
if v.is_banned: return '', 403
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ def speak(data, v):
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
||||||
@socketio.on('connect')
|
@socketio.on('connect')
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def connect(v):
|
def connect(v):
|
||||||
if v.username not in online:
|
if v.username not in online:
|
||||||
online.append(v.username)
|
online.append(v.username)
|
||||||
|
@ -111,7 +111,7 @@ def connect(v):
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
||||||
@socketio.on('disconnect')
|
@socketio.on('disconnect')
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def disconnect(v):
|
def disconnect(v):
|
||||||
if v.username in online:
|
if v.username in online:
|
||||||
online.remove(v.username)
|
online.remove(v.username)
|
||||||
|
@ -123,7 +123,7 @@ def disconnect(v):
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
||||||
@socketio.on('typing')
|
@socketio.on('typing')
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def typing_indicator(data, v):
|
def typing_indicator(data, v):
|
||||||
|
|
||||||
if data and v.username not in typing: typing.append(v.username)
|
if data and v.username not in typing: typing.append(v.username)
|
||||||
|
|
Loading…
Reference in New Issue