#3745, "Must handle Followup-to: poster in news", part II; add an alert warning the user when followup-to: poster is being used, as per the GNKSA.

r=ducarroz, sr=sspitzer
This commit is contained in:
hwaara%chello.se 2001-08-18 12:19:49 +00:00
parent 3d56d99878
commit 6181cc4a50
3 changed files with 19 additions and 2 deletions

View File

@ -191,6 +191,9 @@ noIdentities=You don't have any email identities yet. Create one with the Accou
## @name NS_MSG_GENERIC_FAILURE_EXPLANATION
12562=Please verify that your Mail/News account settings are correct and try again.
## @name NS_FOLLOWUPTO_SENDER
12563=The author of this message has requested that responses be sent only to the author. If you also want to reply to the newsgroup, add a new row to the addressing area, choose Newsgroup from the recipients list, and enter the name of the newsgroup.
## Strings use for the save message dialog shown when the user close a message compose window
saveDlogTitle=Save Message
saveDlogMessage=Message has not been Sent. Do you want to save the message in the Drafts Folder?

View File

@ -1087,6 +1087,7 @@ nsresult nsMsgCompose::SetBodyModified(PRBool modified)
nsresult nsMsgCompose::GetDomWindow(nsIDOMWindowInternal * *aDomWindow)
{
*aDomWindow = m_window;
NS_IF_ADDREF(*aDomWindow);
return NS_OK;
}
@ -1524,7 +1525,7 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
nsresult rv = NS_OK;
nsAutoString aCharset;
nsCOMPtr<nsIMsgCompose>compose = do_QueryReferent(mWeakComposeObj);
nsCOMPtr<nsIMsgCompose> compose = do_QueryReferent(mWeakComposeObj);
if (compose)
{
MSG_ComposeType type;
@ -1624,8 +1625,18 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
if (! followUpTo.IsEmpty())
{
// Handle "followup-to: poster" magic keyword here
if (followUpTo == NS_LITERAL_STRING("poster"))
{
nsCOMPtr<nsIDOMWindowInternal> composeWindow;
nsCOMPtr<nsIPrompt> prompt;
compose->GetDomWindow(getter_AddRefs(composeWindow));
if (composeWindow)
composeWindow->GetPrompter(getter_AddRefs(prompt));
nsMsgDisplayMessageByID(prompt, NS_MSG_FOLLOWUPTO_ALERT);
// If reply-to is empty, use the from header to fetch
// the original sender's email
if (!replyTo.IsEmpty())
compFields->SetTo(replyTo.get());
else
@ -1639,10 +1650,12 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIRequest *request, ns
}
}
// Clear the newsgroup: header field, because followup-to: poster
// only follows up to the original sender
if (! newgroups.IsEmpty())
compFields->SetNewsgroups(nsnull);
}
else
else // Process "followup-to: newsgroup-content" here
{
if (type != nsIMsgCompType::ReplyToSender)
compFields->SetNewsgroups(nsAutoCString(followUpTo));

View File

@ -78,6 +78,7 @@ private:
#define NS_ERROR_SMTP_PASSWORD_UNDEFINED NS_MSG_GENERATE_FAILURE(12530)
#define NS_ERROR_MIME_MPART_ATTACHMENT_ERROR NS_MSG_GENERATE_FAILURE(12531)
#define NS_MSG_FAILED_COPY_OPERATION NS_MSG_GENERATE_FAILURE(12532)
#define NS_MSG_FOLLOWUPTO_ALERT NS_MSG_GENERATE_SUCCESS(12563)
// For message sending operations...
#define NS_MSG_ASSEMBLING_MESSAGE NS_MSG_GENERATE_SUCCESS(12534)