         should = not(_.isEqual(nextState, @state)) or not (_.isEqual(nextProps, @props))
         return should
 
-    _prepareMessage: ->
-        message = @props.message
-
+    _prepareMessage: (message) ->
         # display full headers
         fullHeaders = []
         for key, value of message.get 'headers'

                                span null, t "mail receivers cc"
                                @renderAddress 'cc'
                        if hasAttachments
                            span className: 'hour', prepared.date
                    if not hasAttachments
                        span className: 'hour', prepared.date
                if hasAttachments
                    div className: 'col-md-4',
                        FilePicker
                            ref: 'filePicker'
                            editable: false
                            value: prepared.attachments
                            messageID: @props.message.get 'id'
                #if @props.inConversation
                #    toggleActive

        state =
            active: props.active
        if props.message.get('id') isnt @props.message.get('id')
            @_markRead props.message
            state.messageDisplayHTML   = props.settings.get 'messageDisplayHTML'
            state.messageDisplayImages = props.settings.get 'messageDisplayImages'
            state.composing            = false
        @setState state

    _markRead: (message) ->
        # Hack to prevent infinite loop if server side mark as read fails
        messageID = message.get 'id'
        if @state.currentMessageID isnt messageID
            state =
                currentMessageID: messageID
                prepared: @_prepareMessage message
            # Mark message as seen if needed
            flags = message.get('flags').slice()
            if flags.indexOf(MessageFlags.SEEN) is -1
                flags.push MessageFlags.SEEN
                MessageActionCreator.updateFlag message, flags
            @setState state

    prepareHTML: (html) ->
        messageDisplayHTML = true
        parser = new DOMParser()
        html   = """<html><head>
                <link rel="stylesheet" href="/fonts/fonts.css" />
                <link rel="stylesheet" href="./mail_stylesheet.css" />
                <style>body { visibility: hidden; }</style>
            </head><body>#{html}</body></html>"""
        doc    = parser.parseFromString html, "text/html"
        images = []

