       isMarkUserAsTrollModalVisible : @props.isMarkUserAsTrollModalVisible
 
 
-  componentDidMount: ->
-
-    @getAccountInfo()
 
 
   componentDidUpdate: (prevProps, prevState) ->

    className         : classnames
      'ChatItem'      : yes
      'is-selected'   : @props.isSelected

  getMenuItems: ->

    if checkFlag('super-admin')
    then @getAdminMenuItems()
    else @getDefaultMenuItems()


  getDefaultMenuItems: ->

    return [
      {title: 'Edit Post'   , key: 'editpost'             , onClick: @bound 'editPost'}
      {title: 'Delete Post' , key: 'showdeletepostprompt' , onClick: @bound 'showDeletePostPromptModal'}
    ]


  getAdminMenuItems: ->

    { message } = @props
    markUserMenuItem = {title: 'Mark User as Troll', key: 'markuserastroll', onClick: @bound 'showMarkUserAsTrollPromptModal'}

    getMessageOwner message.toJS(), (err, owner) =>

      return showErrorNotification err  if err

      if owner.isExempt
        markUserMenuItem = {title: 'Unmark User as Troll', key: 'unmarkuserastroll', onClick: @bound 'unMarkUserAsTroll'}

    adminMenuItems = [
      markUserMenuItem
      {
        title   : 'Block User'
        key     : 'blockuser'
        onClick : @bound 'showBlockUserPromptModal'
      }
      {
        title   : 'Impersonate User'
        key     : 'impersonateuser'
        onClick : @bound 'impersonateUser'
      }
    ]

    return @getDefaultMenuItems().concat adminMenuItems


  getDeleteItemModalProps: ->

    title              : "Delete post"
    body               : "Are you sure you want to delete this post?"
    buttonConfirmTitle : "DELETE"
    className          : "Modal-DeleteItemPrompt"
    onConfirm          : @bound "deletePostButtonHandler"
    onAbort            : @bound "closeDeletePostModal"
    onClose            : @bound "closeDeletePostModal"


  getMarkUserAsTrollModalProps: ->

    account            : @state.account
    title              : "MARK USER AS TROLL"
    className          : "MarkUserAsTrollModal"
    onAbort            : @bound "closeMarkUserAsTrollModal"
    onClose            : @bound "closeMarkUserAsTrollModal"
    buttonConfirmTitle : "YES, THIS USER IS DEFINITELY A TROLL"


  getBlockUserModalProps: ->

    account            : @state.account
    buttonConfirmTitle : "BLOCK USER"
    className          : "BlockUserModal"
    onAbort            : @bound "closeBlockUserPromptModal"
    onClose            : @bound "closeBlockUserPromptModal"


  deletePostButtonHandler: (event) ->

    kd.utils.stopDOMEvent event
    ActivityFlux.actions.message.removeMessage @props.message.get('id')
    @closeDeletePostModal()


  closeDeletePostModal: (event) ->

    kd.utils.stopDOMEvent event
    @setState isDeleting: no


  editPost: ->

    messageId = @props.message.get '_id'

    ActivityFlux.actions.message.setMessageEditMode messageId, @props.channelId


  showDeletePostPromptModal: ->

    @setState isDeleting: yes


  showMarkUserAsTrollPromptModal: ->

    @setState isMarkUserAsTrollModalVisible: yes


  closeMarkUserAsTrollModal: (event) ->

    kd.utils.stopDOMEvent event
    @setState isMarkUserAsTrollModalVisible: no


  closeBlockUserPromptModal: (event) ->

    kd.utils.stopDOMEvent event
    @setState isBlockUserModalVisible: no


  unMarkUserAsTroll: (event) ->

    kd.utils.stopDOMEvent event
    AppFlux.actions.user.unmarkUserAsTroll @state.account
    @closeMarkUserAsTrollModal()


  showBlockUserPromptModal: ->

    @setState isBlockUserModalVisible: yes


  impersonateUser: (event) ->

    kd.utils.stopDOMEvent event
    { message } = @props

    AppFlux.actions.user.impersonateUser message.toJS()


  updateMessage: ->

        {@renderEditMode()}
        {@renderEmbedBox()}
        {@renderChatItemMenu()}
      </div>
    </div>

