forked from MarseyWorld/MarseyWorld
make the important part of disconnect always work
parent
6c46de47de
commit
59d984af3f
|
@ -217,24 +217,24 @@ def connect(v):
|
||||||
@socketio.on('disconnect')
|
@socketio.on('disconnect')
|
||||||
@auth_required_socketio
|
@auth_required_socketio
|
||||||
def disconnect(v):
|
def disconnect(v):
|
||||||
|
if request.referrer != f'{SITE_FULL}/notifications/messages':
|
||||||
|
for val in online.values():
|
||||||
|
if [v.username, v.id, v.name_color, v.patron] in val:
|
||||||
|
val.remove([v.username, v.id, v.name_color, v.patron])
|
||||||
|
|
||||||
|
for val in typing.values():
|
||||||
|
if v.username in val:
|
||||||
|
val.remove(v.username)
|
||||||
|
|
||||||
|
refresh_online()
|
||||||
|
|
||||||
|
|
||||||
if request.referrer not in ALLOWED_REFERRERS:
|
if request.referrer not in ALLOWED_REFERRERS:
|
||||||
return '', 400
|
return '', 400
|
||||||
|
elif request.referrer == f'{SITE_FULL}/notifications/messages':
|
||||||
if request.referrer == f'{SITE_FULL}/notifications/messages':
|
|
||||||
leave_room(v.id)
|
leave_room(v.id)
|
||||||
return ''
|
else:
|
||||||
|
leave_room(request.referrer)
|
||||||
leave_room(request.referrer)
|
|
||||||
|
|
||||||
for val in online.values():
|
|
||||||
if [v.username, v.id, v.name_color, v.patron] in val:
|
|
||||||
val.remove([v.username, v.id, v.name_color, v.patron])
|
|
||||||
|
|
||||||
for val in typing.values():
|
|
||||||
if v.username in val:
|
|
||||||
val.remove(v.username)
|
|
||||||
|
|
||||||
refresh_online()
|
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue