 
   pistachio:->
     """
-    <div class='meta'>
-      <span class="author-wrapper">{{#(author)}}</span>
-      <span class='time'>{{$.timeago #(meta.createdAt)}}</span>
+    <div class='meta'>      
+      <span class='time'>[{{#(meta.createdAt)}}] </span>
+      <span class="author-wrapper">[{{#(author)}}]: </span>
+      <span>{{#(body)}}</span>
     </div>
-    <div>{{#(body)}}</div>
     """
 
 class ChannelListItemView extends KDListItemView

    @joinChannel 'public'

  joinChannel: (name) ->
    view = @getOptions().view

    # Presence received has format [key, "bind" || "unbind"]
    mq.presence @username, name, ([presence, status]) =>
      if status is "bind"
        @addOnlineUser presence, name
      else if status is "unbind"
        @removeOfflineUser presence, name

    channelPaneInstance = view.addChannelTab name
    channelName = "client-#{name}"

    channel = new Channel 
      name: name
      view: channelPaneInstance

    channel.view.on "ChatMessageSent", (messageBody) =>
      chatItem = 
        author: @username
        body: messageBody
        meta: {createdAt: new Date()}

      @broadcaster.emit channelName, JSON.stringify(chatItem)
      chatItem.author = "me"
      channel.messageReceived chatItem

    @channels[name] = channel
    @broadcaster.on channelName, (msg) ->
      channel.messageReceived msg

  addOnlineUser: (name, channelName) ->
    channel = @channels[channelName]
    userItemViewInstance = channel.addOnlineUser name
    return if name is @username
    # userItemViewInstance.registerListener
    #   KDEventTypes: 'click'
    #   listener    : @
    #   callback    : =>
    #     @joinChannel name

  removeOfflineUser: (name, channelName) ->
    channel = @channels[channelName]
    channel.removeOfflineUser name

class Channel extends KDEventEmitter
  constructor: (options = {}, data) ->
    @account = KD.whoami()
    @username = @account?.profile?.nickname
    @username = "Guest"+__utils.getRandomNumber() if @username is "Guest"
    @messages = []
    @participants = {}

    @name = options.name
    @view = options.view


      name: "topics"
      unclosable: true
      subItemClass: ChannelListItemView

  ###
  # Called by ChatController to create a tab view for new channel
