fix annoying chat bug (thx CRGD)

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-22 22:47:01 +02:00
parent e2c6321b94
commit b0321745df
1 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ else:
typing = []
online = []
cache.set(ONLINE_STR, len(online))
cache.set(ONLINE_STR, len(online), timeout=0)
muted = cache.get(f'{SITE}_muted') or {}
messages = cache.get(f'{SITE}_chat') or []
total = cache.get(f'{SITE}_total') or 0
@ -96,7 +96,7 @@ def connect(v):
if v.username not in online:
online.append(v.username)
emit("online", online, broadcast=True)
cache.set(ONLINE_STR, len(online))
cache.set(ONLINE_STR, len(online), timeout=0)
emit('typing', typing)
return '', 204
@ -107,7 +107,7 @@ def disconnect(v):
if v.username in online:
online.remove(v.username)
emit("online", online, broadcast=True)
cache.set(ONLINE_STR, len(online))
cache.set(ONLINE_STR, len(online), timeout=0)
if v.username in typing: typing.remove(v.username)
emit('typing', typing, broadcast=True)