add imap msg fetch peek url, part of spam filter work r/sr=sspitzer 169557

This commit is contained in:
bienvenu%netscape.com 2002-10-08 03:52:41 +00:00
Родитель 17111c88a9
Коммит 9481fa3284
2 изменённых файлов: 15 добавлений и 10 удалений

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

@ -188,6 +188,7 @@ interface nsIImapUrl : nsISupports
const long nsImapDeleteFolderAndMsgs = 0x10000033; const long nsImapDeleteFolderAndMsgs = 0x10000033;
const long nsImapUserDefinedMsgCommand = 0x10000034; const long nsImapUserDefinedMsgCommand = 0x10000034;
const long nsImapUserDefinedFetchAttribute = 0x10000035; const long nsImapUserDefinedFetchAttribute = 0x10000035;
const long nsImapMsgFetchPeek = 0x10000036;
}; };
%{C++ %{C++

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

@ -516,7 +516,8 @@ void nsImapUrl::ParseImapPart(char *imapPartOfUrl)
ParseUidChoice(); ParseUidChoice();
PR_FREEIF(m_sourceCanonicalFolderPathSubString); PR_FREEIF(m_sourceCanonicalFolderPathSubString);
ParseFolderPath(&m_sourceCanonicalFolderPathSubString); ParseFolderPath(&m_sourceCanonicalFolderPathSubString);
ParseListOfMessageIds(); ParseListOfMessageIds();
// if fetched by spam filter, the action will be changed to nsImapMsgFetchPeek
} }
else /* if (fInternal) no concept of internal - not sure there will be one */ else /* if (fInternal) no concept of internal - not sure there will be one */
{ {
@ -1524,20 +1525,23 @@ void nsImapUrl::ParseMsgFlags()
void nsImapUrl::ParseListOfMessageIds() void nsImapUrl::ParseListOfMessageIds()
{ {
m_listOfMessageIds = m_tokenPlaceHolder ? nsIMAPGenericParser::Imapstrtok_r(nsnull, IMAP_URL_TOKEN_SEPARATOR, &m_tokenPlaceHolder) : (char *)NULL; m_listOfMessageIds = m_tokenPlaceHolder ? nsIMAPGenericParser::Imapstrtok_r(nsnull, IMAP_URL_TOKEN_SEPARATOR, &m_tokenPlaceHolder) : (char *)NULL;
if (!m_listOfMessageIds) if (!m_listOfMessageIds)
m_validUrl = PR_FALSE; m_validUrl = PR_FALSE;
else else
{ {
m_listOfMessageIds = nsCRT::strdup(m_listOfMessageIds); m_listOfMessageIds = nsCRT::strdup(m_listOfMessageIds);
m_mimePartSelectorDetected = PL_strstr(m_listOfMessageIds, "&part=") != 0 || PL_strstr(m_listOfMessageIds, "?part=") != 0; m_mimePartSelectorDetected = PL_strstr(m_listOfMessageIds, "&part=") != 0 || PL_strstr(m_listOfMessageIds, "?part=") != 0;
// if we're asking for just the body, don't download the whole message. see // if we're asking for just the body, don't download the whole message. see
// nsMsgQuote::QuoteMessage() for the "header=" settings when replying to msgs. // nsMsgQuote::QuoteMessage() for the "header=" settings when replying to msgs.
if (!m_fetchPartsOnDemand) if (!m_fetchPartsOnDemand)
m_fetchPartsOnDemand = (PL_strstr(m_listOfMessageIds, "?header=quotebody") != 0 || m_fetchPartsOnDemand = (PL_strstr(m_listOfMessageIds, "?header=quotebody") != 0 ||
PL_strstr(m_listOfMessageIds, "?header=only") != 0); PL_strstr(m_listOfMessageIds, "?header=only") != 0);
} // if it's a spam filter trying to fetch the msg, don't let it get marked read.
if (PL_strstr(m_listOfMessageIds,"?header=filter") != 0)
m_imapAction = nsImapMsgFetchPeek;
}
} }
void nsImapUrl::ParseCustomMsgFetchAttribute() void nsImapUrl::ParseCustomMsgFetchAttribute()