Skip to content
Snippets Groups Projects
Commit ae892c0d authored by Atanamo's avatar Atanamo
Browse files

Bugfix: Clients were not removed from channels on disconnect

On disconnect, sockets are in no rooms anymore - even before kicking them out manually.
Because of that, removeClient() did cancel in beginning...
But anaway, we have to remove the client from the unique users list - so force it.
parent dac1ee5e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -138,7 +138,8 @@ class Channel
return true
 
removeClient: (clientSocket, isClose=false, isDisconnect=false) ->
return false unless clientSocket.rooms.indexOf(@name) >= 0 # Cancel, if socket is not joined to channel
# Cancel, if socket is not joined to channel (but force on disconnect)
return false if not isDisconnect and clientSocket.rooms.indexOf(@name) < 0
 
log.debug "Removing client #{clientSocket.identity.getName()} from channel '#{@name}' (by close: #{isClose})"
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment