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

Update version of socket.io and changed access to socket.rooms

Socket.io likes to break API on minor versions, grml!
Cannot think of what they would do on major versions...
parent f5087aed
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -29,7 +29,7 @@
"dependencies": {
"q": "~1.4.1",
"express": "~4.13.0",
"socket.io": "~1.3.7",
"socket.io": "~1.4.5",
"irc": "~0.4.1",
"mysql": "~2.10.2"
},
Loading
Loading
Loading
Loading
@@ -94,7 +94,7 @@ class Channel
clientSocket.removeListener 'disconnect', clientSocket[@listenerNameDisconnect]
 
addClient: (clientSocket, isRejoin=false) ->
return false if clientSocket.rooms.indexOf(@name) >= 0 # Cancel, if socket is already joined to channel
return false if @_hasJoinedSocket(clientSocket) # Cancel, if socket is already joined to channel
 
log.debug "Adding client '#{clientSocket.identity.getName()}' to channel '#{@name}'"
 
Loading
Loading
@@ -139,7 +139,7 @@ class Channel
 
removeClient: (clientSocket, isClose=false, isDisconnect=false) ->
# Cancel, if socket is not joined to channel (but force on disconnect)
return false if not isDisconnect and clientSocket.rooms.indexOf(@name) < 0
return false if not isDisconnect and not @_hasJoinedSocket(clientSocket)
 
log.debug "Removing client #{clientSocket.identity.getName()} from channel '#{@name}' (by close: #{isClose})"
 
Loading
Loading
@@ -178,7 +178,7 @@ class Channel
 
# @protected
_deleteByClient: (clientSocket, customRoutine=null) ->
return false unless clientSocket.rooms.indexOf(@name) >= 0 # Cancel, if socket is not joined to channel
return false unless @_hasJoinedSocket(clientSocket) # Cancel, if socket is not joined to channel
 
log.debug "Deleting channel '#{@name}' by client #{clientSocket.identity.getName()}"
 
Loading
Loading
@@ -351,6 +351,10 @@ class Channel
_getCurrentTimestamp: ->
return (new Date()).getTime()
 
_hasJoinedSocket: (clientSocket) ->
#return clientSocket.rooms.indexOf(@name) >= 0 # Working till v1.3.x, then rooms changed to a map
return clientSocket.rooms[@name]?
_hasUniqueClient: (clientSocket) ->
clientIdentity = clientSocket.identity
clientsMap = @_getUniqueClientsMap()
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