 
     channel.view.on "ChatMessageSent", (messageBody) =>
       @parseMessageForChannels messageBody
-      @broadcastOwnMessage channel, messageBody
+      @broadcastOwnMessage messageBody, channel 
       if name isnt PUBLIC
-        @broadcastOwnMessage @channels[PUBLIC], messageBody
+        @broadcastOwnMessage messageBody, @channels[PUBLIC], channel
 
     @broadcaster.on channelName, (msg) ->
       channel.messageReceived msg

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

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

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

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


  messageReceived: (message) ->
    @messages.push message
    @view.newMessage message

class ChatView extends KDView
