diff --git a/mozilla/mailnews/local/src/nsMailboxProtocol.cpp b/mozilla/mailnews/local/src/nsMailboxProtocol.cpp index 04d863b1397..7bae32bd539 100644 --- a/mozilla/mailnews/local/src/nsMailboxProtocol.cpp +++ b/mozilla/mailnews/local/src/nsMailboxProtocol.cpp @@ -243,7 +243,7 @@ nsresult nsMailboxProtocol::LoadUrl(nsIURL * aURL, nsISupports * aConsumer) // create a temp file to write the message into. We need to do this because // we don't have pluggable converters yet. We want to let mkfile do the work of // converting the message from RFC-822 to HTML before displaying it... - + ClearFlag(MAILBOX_MSG_PARSE_FIRST_LINE); m_tempMessageFile->openStreamForWriting(); SetupMessageExtraction(); m_nextState = MAILBOX_READ_MESSAGE; @@ -336,14 +336,18 @@ PRInt32 nsMailboxProtocol::ReadMessageResponse(nsIInputStream * inputStream, PRU the local system will convert that to the local line terminator as it is read. */ - - if (m_tempMessageFile) + // mscott - the firstline hack is aimed at making sure we don't write + // out the dummy header when we are trying to display the message. + // The dummy header is the From line with the date tag on it. + if (m_tempMessageFile && TestFlag(MAILBOX_MSG_PARSE_FIRST_LINE)) { PRInt32 count = 0; if (line) m_tempMessageFile->write(line, PL_strlen(line), &count); m_tempMessageFile->write(MSG_LINEBREAK, MSG_LINEBREAK_LEN, &count); } + else + SetFlag(MAILBOX_MSG_PARSE_FIRST_LINE); } } while (line && !pauseForMoreData); diff --git a/mozilla/mailnews/local/src/nsMailboxProtocol.h b/mozilla/mailnews/local/src/nsMailboxProtocol.h index 0f9d8a33956..8f432070018 100644 --- a/mozilla/mailnews/local/src/nsMailboxProtocol.h +++ b/mozilla/mailnews/local/src/nsMailboxProtocol.h @@ -47,6 +47,7 @@ // commands, etc. I do not intend it to refer to protocol state) #define MAILBOX_PAUSE_FOR_READ 0x00000001 /* should we pause for the next read */ +#define MAILBOX_MSG_PARSE_FIRST_LINE 0x00000002 /* have we read in the first line of the msg */ /* states of the machine */