     .then -> Promise.resolve()
 
   # @private
-  disconnect : (reason, params) ->
-    id = params.id || null
+  disconnect : (reason, {id}) ->
     @removeSocketFromServer id
 
   # @private

    .then -> Promise.resolve()

  # @private
  roomSetWhitelistMode : (roomName, mode) ->
    @state.getRoom roomName
    .then (room) =>
      room.changeMode @userName, mode
    .spread (userNames, mode) =>
      if @enableAccessListsUpdates
        @transport.sendToChannel roomName, 'roomModeChanged', roomName, mode
      @removeRoomUsers roomName, userNames

  # @private
  systemMessage : (data, params) ->
    id = params.id || null
    @transport.sendToOthers id, @echoChannel, 'systemMessage', data



      .then -> Promise.resolve()

  # @private
  roomCreate : (roomName, whitelistOnly, {bypassPermissions}) ->
    if not @enableRoomsManagement and not bypassPermissions
      error = new ChatServiceError 'notAllowed'
      return Promise.reject error
    checkNameSymbols roomName
