forked from MarseyWorld/MarseyWorld
make the important part of disconnect always work
parent
6c46de47de
commit
59d984af3f
|
@ -217,15 +217,7 @@ def connect(v):
|
|||
@socketio.on('disconnect')
|
||||
@auth_required_socketio
|
||||
def disconnect(v):
|
||||
if request.referrer not in ALLOWED_REFERRERS:
|
||||
return '', 400
|
||||
|
||||
if request.referrer == f'{SITE_FULL}/notifications/messages':
|
||||
leave_room(v.id)
|
||||
return ''
|
||||
|
||||
leave_room(request.referrer)
|
||||
|
||||
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])
|
||||
|
@ -236,6 +228,14 @@ def disconnect(v):
|
|||
|
||||
refresh_online()
|
||||
|
||||
|
||||
if request.referrer not in ALLOWED_REFERRERS:
|
||||
return '', 400
|
||||
elif request.referrer == f'{SITE_FULL}/notifications/messages':
|
||||
leave_room(v.id)
|
||||
else:
|
||||
leave_room(request.referrer)
|
||||
|
||||
return ''
|
||||
|
||||
@socketio.on('typing')
|
||||
|
|
Loading…
Reference in New Issue