     @updateDate details.time
     @lastMessage = @lastChatItem.message
     @emit "NewChatItemCreated"
-    @scrollToBottom()
 
   appendToChatItem: (params) ->
     {details}  = params

    params           = { details, ownerNickname, ownerAccount }
    @lastMessageBody = details.body

    if @lastChatItemOwner is ownerNickname
      @appendToChatItem params
      @updateDate details.time
      return  @scrollToTop()

    @createNewChatItem params

  createNewChatItem: (params) ->
    {details, ownerAccount, ownerNickname} = params

    element = @messages.getElement()
    element.scrollTop = element.scrollHeight

  isScrollTopAtBottom: ->
    element = @messages.getElement()
    height = parseInt window.getComputedStyle(element).height, 10
    return (element.scrollTop + height) is element.scrollHeight

  pistachio: ->
    """
      {{> @dock}}
