master
Aevann1 2022-03-20 01:33:55 +02:00
parent cd79cfaa8d
commit b4cf4b0574
1 changed files with 13 additions and 14 deletions

View File

@ -14,20 +14,19 @@ def chat( v):
return render_template("chat.html", v=v)
if "load_chat" in sys.argv:
sex = SocketIO(app)
sex = SocketIO(app)
@sex.on('speak')
@auth_required
def speak(data, v):
@sex.on('speak')
@auth_required
def speak(data, v):
data={
"avatar": v.profile_url,
"username":v.username,
"text":sanitize(data[:1000].strip()),
"time": time.strftime("%d %b %Y at %H:%M:%S", time.gmtime(int(time.time()))),
"userlink":v.url
}
data={
"avatar": v.profile_url,
"username":v.username,
"text":sanitize(data[:1000].strip()),
"time": time.strftime("%d %b %Y at %H:%M:%S", time.gmtime(int(time.time()))),
"userlink":v.url
}
emit('speak', data)
return '', 204
emit('speak', data)
return '', 204