   return r
 
 
-# Implements room messaging with permissions checking.
-class Room
-
-  # @param server [object] ChatService object
-  # @param name [string] Room name
-  constructor : (@server, @name) ->
-    @errorBuilder = @server.errorBuilder
-    state = @server.chatState.roomState
-    @roomState = new state @server, @name, @server.historyMaxMessages
-
-  # Resets room state according to the object.
-  # @param state [object]
-  # @param cb [callback]
-  initState : (state, cb) ->
-    @roomState.initState state, cb
+# @private
+# @mixin
+RoomHelpers =
 
   # @private
   isAdmin : (userName, cb) ->

        cb error, data if cb
      cmd args..., ack, socket.id

  # @private
  withRoom : (roomName, fn) ->
    @chatState.getRoom roomName, fn

      @directMessagingState.whitelistOnlySet m, cb


# @private
# @mixin
CommandBinders =

  # @private
  wrapCommand : (name, fn) ->
