зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 14561, Already checked in the M10 BRANCH. Error must have negative value. A=choffman, R=mscott
This commit is contained in:
Родитель
da1cf6530f
Коммит
88a9f70faa
|
@ -117,6 +117,13 @@ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MAILNEWS, value)
|
|||
|
||||
#define NS_MSG_ERROR_WRITING_MAIL_FOLDER NS_MSG_GENERATE_FAILURE(15)
|
||||
|
||||
/* ducarroz: error codes for message compose are defined into compose\src\nsMsgComposeStringBundle.h.
|
||||
Message compose use the same error code space than other mailnews modules. To avoid any
|
||||
conflict, I reserve values between 12500 and 12999 for it.
|
||||
*/
|
||||
#define NS_MSGCOMP_ERROR_BEGIN 12500
|
||||
#define NS_MSGCOMP_ERROR_END 12999
|
||||
|
||||
#define MSG_LINEBREAK NS_LINEBREAK
|
||||
#define MSG_LINEBREAK_LEN NS_LINEBREAK_LEN
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
12512=Error writing temporary file.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER
|
||||
-12513=An error occurred sending mail: Mozilla was unable to connect to the SMTP server. The server may be down or may be incorrectly configured. Please verify that your Mail preferences are correct and try again.
|
||||
12513=An error occurred sending mail: Mozilla was unable to connect to the SMTP server. The server may be down or may be incorrectly configured. Please verify that your Mail preferences are correct and try again.
|
||||
|
||||
## @name NS_ERROR_SENDING_FROM_COMMAND
|
||||
12514=An error occurred while sending mail. The mail server responded: %s Please verify that your email address is correct in your Mail preferences and try again.
|
||||
|
|
|
@ -157,11 +157,7 @@ nsresult mime_sanity_check_fields (
|
|||
else
|
||||
if ((!to || !*to) && (!cc || !*cc) &&
|
||||
(!bcc || !*bcc) && (!newsgroups || !*newsgroups))
|
||||
#if 0
|
||||
return NS_MSG_NO_RECIPIENTS;
|
||||
#else
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
#endif
|
||||
else
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsMsgSend.h"
|
||||
#include "nsMsgCreate.h"
|
||||
#include "nsMailHeaders.h"
|
||||
#include "nsMsgPrompts.h"
|
||||
|
||||
// XXX temporary so we can use the current identity hack -alecf
|
||||
#include "nsIMsgMailSession.h"
|
||||
|
@ -366,6 +367,11 @@ nsresult nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode,
|
|||
}
|
||||
|
||||
rv = _SendMsg(deliverMode, identity, callback);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
ShowWindow(PR_TRUE);
|
||||
nsMsgDisplayMessageByID(rv);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -443,6 +449,11 @@ nsMsgCompose::SendMsgEx(MSG_DeliverMode deliverMode,
|
|||
else
|
||||
rv = NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
ShowWindow(PR_TRUE);
|
||||
nsMsgDisplayMessageByID(rv);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -919,6 +930,8 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnDataAvailable(nsIChannel * /* aChan
|
|||
|
||||
PRUint32 numWritten = 0;
|
||||
rv = inStr->Read(newBuf, count, &numWritten);
|
||||
if (rv == NS_BASE_STREAM_WOULD_BLOCK)
|
||||
rv = NS_OK;
|
||||
newBuf[count] = '\0';
|
||||
if (NS_SUCCEEDED(rv) && numWritten > 0)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "nsIPref.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURI.h"
|
||||
#include "msgCore.h"
|
||||
|
||||
/* This is the next generation string retrieval call */
|
||||
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
|
@ -54,6 +55,10 @@ ComposeGetStringByID(PRInt32 stringID)
|
|||
if (NS_SUCCEEDED(res))
|
||||
{
|
||||
PRUnichar *ptrv = nsnull;
|
||||
|
||||
if (NS_IS_MSG_ERROR(stringID))
|
||||
stringID = NS_ERROR_GET_CODE(stringID);
|
||||
|
||||
res = sBundle->GetStringFromID(stringID, &ptrv);
|
||||
|
||||
NS_RELEASE(sBundle);
|
||||
|
|
|
@ -20,41 +20,38 @@
|
|||
#define _nsMsgComposeStringBundle_H_
|
||||
|
||||
#include "nscore.h"
|
||||
#include "msgCore.h"
|
||||
|
||||
//
|
||||
// The defines needed for error conditions. The corresponding strings
|
||||
// are defined in composebe.properties
|
||||
// The defines needed for error conditions and status. The corresponding strings
|
||||
// are defined in composeMsgs.properties
|
||||
//
|
||||
#define NS_MSG_UNABLE_TO_OPEN_FILE 12500
|
||||
#define NS_MSG_UNABLE_TO_OPEN_TMP_FILE 12501
|
||||
#define NS_MSG_UNABLE_TO_SAVE_TEMPLATE 12502
|
||||
#define NS_MSG_UNABLE_TO_SAVE_DRAFT 12503
|
||||
#define NS_MSG_LOAD_ATTACHMNTS 12504
|
||||
#define NS_MSG_LOAD_ATTACHMNT 12505
|
||||
#define NS_MSG_COULDNT_OPEN_FCC_FILE 12506
|
||||
#define NS_MSG_CANT_POST_TO_MULTIPLE_NEWS_HOSTS 12507
|
||||
#define NS_MSG_ASSEMB_DONE_MSG 12508
|
||||
#define NS_MSG_ASSEMBLING_MSG 12509
|
||||
#define NS_MSG_NO_SENDER 12510
|
||||
#define NS_MSG_NO_RECIPIENTS 12511
|
||||
|
||||
// We want error codes to be negative #s...then we can be
|
||||
// extra nifty and pass these values in as nsresults and they
|
||||
// will be properly detected as failure codes.
|
||||
|
||||
#define NS_MSG_ERROR_WRITING_FILE 12512
|
||||
#define NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER -12513
|
||||
#define NS_ERROR_SENDING_FROM_COMMAND 12514
|
||||
#define NS_ERROR_SENDING_RCPT_COMMAND 12515
|
||||
#define NS_ERROR_SENDING_DATA_COMMAND 12516
|
||||
#define NS_ERROR_SENDING_MESSAGE 12517
|
||||
#define NS_ERROR_SERVER_ERROR 12518
|
||||
#define NS_ERROR_QUEUED_DELIVERY_FAILED 12519
|
||||
#define NS_ERROR_SEND_FAILED 12520
|
||||
#define SMTP_DELIV_MAIL 12521
|
||||
#define SMTP_MESSAGE_SENT_WAITING_MAIL_REPLY 12522
|
||||
#define SMTP_PROGRESS_MAILSENT 12523
|
||||
#define SMTP_SERVER_ERROR 12524
|
||||
#define NS_MSG_UNABLE_TO_OPEN_FILE NS_MSG_GENERATE_FAILURE(12500)
|
||||
#define NS_MSG_UNABLE_TO_OPEN_TMP_FILE NS_MSG_GENERATE_FAILURE(12501)
|
||||
#define NS_MSG_UNABLE_TO_SAVE_TEMPLATE NS_MSG_GENERATE_FAILURE(12502)
|
||||
#define NS_MSG_UNABLE_TO_SAVE_DRAFT NS_MSG_GENERATE_FAILURE(12503)
|
||||
#define NS_MSG_LOAD_ATTACHMNTS NS_MSG_GENERATE_SUCCESS(12504)
|
||||
#define NS_MSG_LOAD_ATTACHMNT NS_MSG_GENERATE_SUCCESS(12505
|
||||
#define NS_MSG_COULDNT_OPEN_FCC_FILE NS_MSG_GENERATE_FAILURE(12506)
|
||||
#define NS_MSG_CANT_POST_TO_MULTIPLE_NEWS_HOSTS NS_MSG_GENERATE_FAILURE(12507)
|
||||
#define NS_MSG_ASSEMB_DONE_MSG NS_MSG_GENERATE_SUCCESS(12508)
|
||||
#define NS_MSG_ASSEMBLING_MSG NS_MSG_GENERATE_SUCCESS(12509)
|
||||
#define NS_MSG_NO_SENDER NS_MSG_GENERATE_FAILURE(12510)
|
||||
#define NS_MSG_NO_RECIPIENTS NS_MSG_GENERATE_FAILURE(12511)
|
||||
#define NS_MSG_ERROR_WRITING_FILE NS_MSG_GENERATE_FAILURE(12512)
|
||||
#define NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER NS_MSG_GENERATE_FAILURE(12513)
|
||||
#define NS_ERROR_SENDING_FROM_COMMAND NS_MSG_GENERATE_FAILURE(12514)
|
||||
#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_SERVER_ERROR NS_MSG_GENERATE_FAILURE(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)
|
||||
#define SMTP_MESSAGE_SENT_WAITING_MAIL_REPLY NS_MSG_GENERATE_SUCCESS(12522)
|
||||
#define SMTP_PROGRESS_MAILSENT NS_MSG_GENERATE_SUCCESS(12523)
|
||||
#define SMTP_SERVER_ERROR NS_MSG_GENERATE_FAILURE(12524)
|
||||
|
||||
NS_BEGIN_EXTERN_C
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
12512=Error writing temporary file.
|
||||
|
||||
## @name NS_ERROR_COULD_NOT_LOGIN_TO_SMTP_SERVER
|
||||
-12513=An error occurred sending mail: Mozilla was unable to connect to the SMTP server. The server may be down or may be incorrectly configured. Please verify that your Mail preferences are correct and try again.
|
||||
12513=An error occurred sending mail: Mozilla was unable to connect to the SMTP server. The server may be down or may be incorrectly configured. Please verify that your Mail preferences are correct and try again.
|
||||
|
||||
## @name NS_ERROR_SENDING_FROM_COMMAND
|
||||
12514=An error occurred while sending mail. The mail server responded: %s Please verify that your email address is correct in your Mail preferences and try again.
|
||||
|
|
Загрузка…
Ссылка в новой задаче