mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
add reply to list compose msg type, patch by pcmccurdy@hotmail.com, sr=bienvenu 45715
This commit is contained in:
parent
a6117f7ac0
commit
9aae284791
@ -258,7 +258,10 @@ function ComposeMessage(type, format, folder, messageArray)
|
||||
var messageIDScheme = messageID ? messageID.split(":")[0] : "";
|
||||
if (messageIDScheme && (messageIDScheme == 'http' || messageIDScheme == 'https') && "openComposeWindowForRSSArticle" in this)
|
||||
openComposeWindowForRSSArticle(messageID, hdr, type);
|
||||
else if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
|
||||
else if (type == msgComposeType.Reply ||
|
||||
type == msgComposeType.ReplyAll ||
|
||||
type == msgComposeType.ReplyToList ||
|
||||
type == msgComposeType.ForwardInline ||
|
||||
type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender ||
|
||||
type == msgComposeType.ReplyToSenderAndGroup ||
|
||||
type == msgComposeType.Template || type == msgComposeType.Draft)
|
||||
|
@ -267,7 +267,9 @@ function ComposeMessage(type, format, folder, messageArray)
|
||||
}
|
||||
}
|
||||
|
||||
if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
|
||||
if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll ||
|
||||
type == msgComposeType.ReplyToList ||
|
||||
type == msgComposeType.ForwardInline ||
|
||||
type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender ||
|
||||
type == msgComposeType.ReplyToSenderAndGroup ||
|
||||
type == msgComposeType.Template || type == msgComposeType.Draft)
|
||||
|
@ -59,6 +59,7 @@ interface nsIMsgCompType {
|
||||
const long Template = 10;
|
||||
const long MailToUrl = 11;
|
||||
const long ReplyWithTemplate = 12;
|
||||
const long ReplyToList = 13;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1751,6 +1751,7 @@ nsresult nsMsgCompose::CreateMessage(const char * originalMsgURI,
|
||||
default: break;
|
||||
case nsIMsgCompType::Reply :
|
||||
case nsIMsgCompType::ReplyAll:
|
||||
case nsIMsgCompType::ReplyToList:
|
||||
case nsIMsgCompType::ReplyToGroup:
|
||||
case nsIMsgCompType::ReplyToSender:
|
||||
case nsIMsgCompType::ReplyToSenderAndGroup:
|
||||
@ -2196,8 +2197,13 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
|
||||
if (!mCiteReference.IsEmpty())
|
||||
compose->SetCiteReference(mCiteReference);
|
||||
|
||||
if (mHeaders && (type == nsIMsgCompType::Reply || type == nsIMsgCompType::ReplyAll || type == nsIMsgCompType::ReplyToSender ||
|
||||
type == nsIMsgCompType::ReplyToGroup || type == nsIMsgCompType::ReplyToSenderAndGroup) && mQuoteOriginal)
|
||||
if (mHeaders && (type == nsIMsgCompType::Reply ||
|
||||
type == nsIMsgCompType::ReplyAll ||
|
||||
type == nsIMsgCompType::ReplyToList ||
|
||||
type == nsIMsgCompType::ReplyToSender ||
|
||||
type == nsIMsgCompType::ReplyToGroup ||
|
||||
type == nsIMsgCompType::ReplyToSenderAndGroup) &&
|
||||
mQuoteOriginal)
|
||||
{
|
||||
nsCOMPtr<nsIMsgCompFields> compFields;
|
||||
compose->GetCompFields(getter_AddRefs(compFields));
|
||||
@ -2213,6 +2219,7 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
|
||||
nsAutoString followUpTo;
|
||||
nsAutoString messageId;
|
||||
nsAutoString references;
|
||||
nsAutoString listPost;
|
||||
nsXPIDLCString outCString;
|
||||
PRBool needToRemoveDup = PR_FALSE;
|
||||
if (!mMimeConverter)
|
||||
@ -2257,6 +2264,29 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
|
||||
|
||||
needToRemoveDup = PR_TRUE;
|
||||
}
|
||||
|
||||
mHeaders->ExtractHeader(HEADER_LIST_POST, PR_TRUE, getter_Copies(outCString));
|
||||
if (!outCString.IsEmpty())
|
||||
mMimeConverter->DecodeMimeHeader(outCString, listPost, charset);
|
||||
|
||||
if (type == nsIMsgCompType::ReplyToList && ! listPost.IsEmpty())
|
||||
{
|
||||
nsString::const_iterator mailtoStart, mailtoEnd;
|
||||
listPost.BeginReading(mailtoStart);
|
||||
listPost.EndReading(mailtoEnd);
|
||||
nsAutoString mailtoText(NS_LITERAL_STRING("<mailto:"));
|
||||
PRBool mailtoFound = FindInReadable(mailtoText, mailtoStart, mailtoEnd);
|
||||
|
||||
// Strip off the leading "<mailto:" and trailing ">"
|
||||
if (mailtoFound && listPost.Equals(mailtoStart.get()) &&
|
||||
listPost.RFindChar('>') == listPost.Length() - 1)
|
||||
{
|
||||
listPost.Cut(0, mailtoText.Length());
|
||||
listPost.Cut(listPost.Length() - 1, 1);
|
||||
|
||||
compFields->SetTo(listPost);
|
||||
}
|
||||
}
|
||||
|
||||
mHeaders->ExtractHeader(HEADER_REPLY_TO, PR_FALSE, getter_Copies(outCString));
|
||||
if (outCString)
|
||||
@ -2294,7 +2324,8 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
|
||||
mMimeConverter->DecodeMimeHeader(outCString, references, charset);
|
||||
}
|
||||
|
||||
if (! ((type == nsIMsgCompType::ReplyAll) && ! mailFollowupTo.IsEmpty()))
|
||||
if (! ((type == nsIMsgCompType::ReplyAll) && ! mailFollowupTo.IsEmpty()) &&
|
||||
! ((type == nsIMsgCompType::ReplyToList) && ! listPost.IsEmpty()))
|
||||
{
|
||||
if (! mailReplyTo.IsEmpty())
|
||||
{ // handle Mail-Reply-To (http://cr.yp.to/proto/replyto.html)
|
||||
@ -2796,6 +2827,7 @@ NS_IMETHODIMP nsMsgCompose::RememberQueuedDisposition()
|
||||
// the header that we then look at when we actually send the message.
|
||||
if (mType == nsIMsgCompType::Reply ||
|
||||
mType == nsIMsgCompType::ReplyAll ||
|
||||
mType == nsIMsgCompType::ReplyToList ||
|
||||
mType == nsIMsgCompType::ReplyToGroup ||
|
||||
mType == nsIMsgCompType::ReplyToSender ||
|
||||
mType == nsIMsgCompType::ReplyToSenderAndGroup ||
|
||||
@ -2834,6 +2866,7 @@ nsresult nsMsgCompose::ProcessReplyFlags()
|
||||
// for this URI.
|
||||
if (mType == nsIMsgCompType::Reply ||
|
||||
mType == nsIMsgCompType::ReplyAll ||
|
||||
mType == nsIMsgCompType::ReplyToList ||
|
||||
mType == nsIMsgCompType::ReplyToGroup ||
|
||||
mType == nsIMsgCompType::ReplyToSender ||
|
||||
mType == nsIMsgCompType::ReplyToSenderAndGroup ||
|
||||
@ -3745,6 +3778,7 @@ nsMsgCompose::BuildBodyMessageAndSignature()
|
||||
case nsIMsgCompType::New :
|
||||
case nsIMsgCompType::Reply : /* should not happen! but just in case */
|
||||
case nsIMsgCompType::ReplyAll : /* should not happen! but just in case */
|
||||
case nsIMsgCompType::ReplyToList : /* should not happen! but just in case */
|
||||
case nsIMsgCompType::ForwardAsAttachment : /* should not happen! but just in case */
|
||||
case nsIMsgCompType::ForwardInline :
|
||||
case nsIMsgCompType::NewsPost :
|
||||
|
@ -65,6 +65,7 @@
|
||||
#define HEADER_FROM "From"
|
||||
#define HEADER_STATUS "Status"
|
||||
#define HEADER_LINES "Lines"
|
||||
#define HEADER_LIST_POST "List-Post"
|
||||
#define HEADER_MAIL_FOLLOWUP_TO "Mail-Followup-To"
|
||||
#define HEADER_MAIL_REPLY_TO "Mail-Reply-To"
|
||||
#define HEADER_MESSAGE_ID "Message-ID"
|
||||
|
Loading…
Reference in New Issue
Block a user