better fix for 204874 problems with custom proprietary envelope command with imap sent folder, r/sr/a=sspitzer

This commit is contained in:
bienvenu%netscape.com 2003-05-10 14:48:24 +00:00
Родитель a10abe7fb3
Коммит 315c0fe989
3 изменённых файлов: 25 добавлений и 23 удалений

Просмотреть файл

@ -2898,14 +2898,7 @@ nsImapProtocol::FetchMessage(const char * messageIds,
headersToDL = PR_smprintf("%s %s",dbHeaders, arbitraryHeaders.get());
if (aolImapServer)
{
// we're not going to use the envelope command on Sent Items because it
// replaces sender with recipient.
if (strcmp(GetServerStateParser().GetSelectedMailboxName(), "Sent Items"))
what = strdup(" XAOL-ENVELOPE INTERNALDATE)");
else
what = strdup(" BODY.PEEK[HEADER.FIELDS (From To Subject)] INTERNALDATE)");
}
what = strdup(" XAOL-ENVELOPE INTERNALDATE)");
else if (gUseEnvelopeCmd)
what = PR_smprintf(" ENVELOPE BODY.PEEK[HEADER.FIELDS (%s)])", headersToDL);
else

Просмотреть файл

@ -1251,18 +1251,18 @@ void nsImapServerResponseParser::msg_fetch()
envelope_data();
}
else if (!PL_strcasecmp(fNextToken, "INTERNALDATE"))
{
fDownloadingHeaders = PR_TRUE; // we only request internal date while downloading headers
if (!bNeedEndMessageDownload)
BeginMessageDownload(MESSAGE_RFC822);
bNeedEndMessageDownload = PR_TRUE;
{
fDownloadingHeaders = PR_TRUE; // we only request internal date while downloading headers
if (!bNeedEndMessageDownload)
BeginMessageDownload(MESSAGE_RFC822);
bNeedEndMessageDownload = PR_TRUE;
internal_date();
}
}
else if (!PL_strcasecmp(fNextToken, "XAOL-ENVELOPE"))
{
fDownloadingHeaders = PR_TRUE;
if (!bNeedEndMessageDownload)
BeginMessageDownload(MESSAGE_RFC822);
if (!bNeedEndMessageDownload)
BeginMessageDownload(MESSAGE_RFC822);
bNeedEndMessageDownload = PR_TRUE;
xaolenvelope_data();
}
@ -1415,7 +1415,19 @@ void nsImapServerResponseParser::xaolenvelope_data()
fNextToken = GetNextToken();
if (ContinueParse())
{
nsCAutoString fromLine("From: ");
nsCAutoString fromLine;
if (!strcmp(GetSelectedMailboxName(), "Sent Items"))
{
// xaol envelope switches the From with the To, so we switch them back and
// create a fake from line From: user@aol.com
fromLine.Append("To: ");
nsCAutoString fakeFromLine(NS_LITERAL_CSTRING("From: ") + nsDependentCString(fServerConnection.GetImapUserName()) + NS_LITERAL_CSTRING("@aol.com"));
fServerConnection.HandleMessageDownLoadLine(fakeFromLine.get(), PR_FALSE);
}
else
{
fromLine.Append("From: ");
}
parse_address(fromLine);
fServerConnection.HandleMessageDownLoadLine(fromLine.get(), PR_FALSE);
if (ContinueParse())

Просмотреть файл

@ -292,12 +292,9 @@ nsImapMailboxSpec::nsImapMailboxSpec()
nsImapMailboxSpec::~nsImapMailboxSpec()
{
if (allocatedPathName)
nsCRT::free(allocatedPathName);
if (unicharPathName)
nsCRT::free(unicharPathName);
if (hostName)
nsCRT::free(hostName);
nsCRT::free(allocatedPathName);
nsCRT::free(unicharPathName);
nsCRT::free(hostName);
}
NS_IMPL_GETSET(nsImapMailboxSpec, Folder_UIDVALIDITY, PRInt32, folder_UIDVALIDITY);