 
   messageReceived: (message) ->
     @messages.push message
-    message.channel = @name
     @view.newMessage message
 
 class ChatView extends KDView


    channel.view.on "ChatMessageSent", (messageBody) =>
      @parseMessageForChannels messageBody
      @broadcastOwnMessage channel, messageBody
      if name isnt PUBLIC
        @broadcastOwnMessage @channels[PUBLIC], messageBody

    @broadcaster.on channelName, (msg) ->
      channel.messageReceived msg

    while match = topicExp.exec message
      channelName = match[1]
      channel = @joinChannel channelName
      @broadcastOwnMessage message, channel

  broadcastOwnMessage: (messageBody, toChannel, fromChannel) ->
    chatItem = 
      author: @username
      body: messageBody
      meta: {createdAt: new Date().toISOString()}

    chatItem.channel = "#"+fromChannel.name if fromChannel

    channelMQName = "client-#{toChannel.name}"
    @broadcaster.emit channelMQName, JSON.stringify(chatItem)
    chatItem.author = "me"
    toChannel.messageReceived chatItem

class Channel extends KDEventEmitter
  constructor: (options = {}, data) ->
