Fix for bug 96386. When a generic or unknown error occures while posting a message, we should report a post error instead of a send error. Also, the send unsent message listener should not display errors. Finally, the Display Send Report function should avoid displaying twice the same string. R=varada, sr=mscott

This commit is contained in:
ducarroz%netscape.com 2001-09-19 03:28:23 +00:00
parent 879d1c6b94
commit 0f8a927dc0
4 changed files with 11 additions and 22 deletions

View File

@ -64,6 +64,7 @@ private:
#define NS_ERROR_SENDING_RCPT_COMMAND NS_MSG_GENERATE_FAILURE(12515)
#define NS_ERROR_SENDING_DATA_COMMAND NS_MSG_GENERATE_FAILURE(12516)
#define NS_ERROR_SENDING_MESSAGE NS_MSG_GENERATE_FAILURE(12517)
#define NS_ERROR_POST_FAILED NS_MSG_GENERATE_FAILURE(12520) // Fix me: should use it's own string 12518!
#define NS_ERROR_QUEUED_DELIVERY_FAILED NS_MSG_GENERATE_FAILURE(12519)
#define NS_ERROR_SEND_FAILED NS_MSG_GENERATE_FAILURE(12520)
#define SMTP_DELIV_MAIL NS_MSG_GENERATE_SUCCESS(12521)

View File

@ -2819,7 +2819,7 @@ SendDeliveryCallback(nsIURI *aUrl, nsresult aExitCode, nsMsgDeliveryType deliver
{
if (NS_FAILED(aExitCode))
if (aExitCode != NS_ERROR_ABORT && !NS_IS_MSG_ERROR(aExitCode))
aExitCode = NS_ERROR_SEND_FAILED;
aExitCode = NS_ERROR_POST_FAILED;
msgSend->DeliverAsNewsExit(aUrl, aExitCode);
}

View File

@ -391,23 +391,6 @@ SendOperationListener::OnStopSending(const char *aMsgID, nsresult aStatus, const
++(mSendLater->mTotalSentSuccessfully);
}
else
{
/*TODO
if (mSendReport)
{
// shame we can't get access to a prompt interface from here...=(
mSendReport->SetError(nsIMsgSendReport::process_Current, aStatus, PR_FALSE);
mSendReport->DisplayReport(nsnull, PR_TRUE, PR_TRUE, &aStatus);
}
else
*/
{
// shame we can't get access to a prompt interface from here...=(
if (aStatus != NS_ERROR_BUT_DONT_SHOW_ALERT && aStatus != NS_ERROR_ABORT)
nsMsgDisplayMessageByID(nsnull, NS_ERROR_SEND_FAILED);
}
}
// Regardless, we will still keep trying to send the rest...
rv = mSendLater->StartNextMailFileSend();

View File

@ -342,10 +342,15 @@ NS_IMETHODIMP nsMsgSendReport::DisplayReport(nsIPrompt *prompt, PRBool showError
if (!currMessage.IsEmpty())
{
nsAutoString temp((const PRUnichar *)dialogMessage); // Because of bug 74726, we cannot use directly an XPIDLString
if (! dialogMessage.IsEmpty())
temp.Append(NS_LITERAL_STRING("\n"));
temp.Append(currMessage);
dialogMessage.Adopt(temp.ToNewUnicode());
//Don't need to repeat ourself!
if (! currMessage.Equals(temp))
{
if (! dialogMessage.IsEmpty())
temp.Append(NS_LITERAL_STRING("\n"));
temp.Append(currMessage);
dialogMessage.Adopt(temp.ToNewUnicode());
}
}
if (askToGoBackToCompose)