       for chan in @channels when chan.isMember(channel, topic)
         chan.trigger(event, message)
 
-  exports+  exports

    rejoin: (chan) ->
      chan.reset()
      {channel, topic, message} = chan
      @send(channel: channel, topic: topic, event: "join", message: message)
      chan.callback(chan)


    join: (channel, topic, message, callback, onJoin) ->
      chan = new exports.Channel(channel, topic, message, callback, onJoin, this)
      @channels.push(chan)
      @rejoin(chan) if @isConnected()



    bindings: null

    constructor: (@channel, @topic, @message, @callback, @socket) ->
      @reset()


    reset: -> @bindings = []

    on: (event, callback) -> @bindings.push({event, callback})

