                 onCancel: =>
                     @setState composing: false
 
-    renderToolbox: (id, prepared) ->
+    renderToolbox: (message) ->
 
         if @state.composing
             return
 
-        isFlagged = prepared.flags.indexOf(FlagsConstants.FLAGGED) is -1
-        isSeen    = prepared.flags.indexOf(FlagsConstants.SEEN) is -1
+        flags     = message.get('flags') or []
+        isFlagged = flags.indexOf(FlagsConstants.FLAGGED) is -1
+        isSeen    = flags.indexOf(FlagsConstants.SEEN) is -1
 
 
         conversationID = @props.message.get 'conversationID'

            else
                fullHeaders.push "#{key}: #{value}"

        if @state.active
            text = message.get 'text'
            html = message.get 'html'
            alternatives = message.get 'alternatives'
            urls = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/gim
            # Some calendar invite may contain neither text nor HTML part
            if not text? and not html? and alternatives?.length > 0
                text = t 'calendar unknown format'

            #
            # @TODO Do we want to convert text only messages to HTML ?
            # /!\ if messageDisplayHTML is set, this method should always return
            # a value fo html, otherwise the content of the email flashes
            if text? and not html? and @state.messageDisplayHTML
                try
                    html = markdown.toHTML text.replace(/(^>.*$)([^>]+)/gm, "$1\n$2")
                catch e
                    html = "<div class='text'>#{text}</div>" #markdown.toHTML text

            if html? and not text? and not @state.messageDisplayHTML
                text = toMarkdown html

            if text?
                rich = text.replace urls, '<a href="$1" target="_blank">$1</a>'
                rich = rich.replace /^>>>>>[^>]?.*$/gim, '<span class="quote5">$&</span>'
                rich = rich.replace /^>>>>[^>]?.*$/gim, '<span class="quote4">$&</span>'
                rich = rich.replace /^>>>[^>]?.*$/gim, '<span class="quote3">$&</span>'
                rich = rich.replace /^>>[^>]?.*$/gim, '<span class="quote2">$&</span>'
                rich = rich.replace /^>[^>]?.*$/gim, '<span class="quote1">$&</span>'

        return {
            id         : message.get 'id'
            attachments: message.get 'attachments'
            flags      : message.get 'flags' or []
            from       : message.get 'from'
            to         : message.get 'to'
            cc         : message.get 'cc'
            fullHeaders: fullHeaders
            text       : text
            rich       : rich
            html       : html
            date       : MessageUtils.formatDate message.get 'createdAt'
        }

    componentWillMount: ->

                    img className: 'sender-avatar', src: avatar
                else
                    i className: 'sender-avatar fa fa-user'
                span className: 'participants', @getParticipants message
                if @state.active
                    i
                        className: 'toggle-headers fa fa-toggle-down clickable'
                        onClick: @toggleHeaders
                #span className: 'subject', @props.message.get 'subject'
                span className: 'hour', date
                span className: "flags",
                    i
                        className: 'attach fa fa-paperclip clickable'
