зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 17902. Fix various FCC problems as well error display. R=alecf, A=chofmann
This commit is contained in:
Родитель
55c3a9b47c
Коммит
818e82215c
|
@ -112,3 +112,6 @@
|
|||
|
||||
## @name NS_ERROR_MIME_MPART_ATTACHMENT_ERROR
|
||||
12531=Attachment error.
|
||||
|
||||
## @name NS_MSG_FAILED_COPY_OPERATION
|
||||
12532=Your Send operation was successful, but copying the message to your Sent folder failed. Would you like to return to the compose window?
|
||||
|
|
|
@ -2073,7 +2073,12 @@ GetFolderURIFromUserPrefs(nsMsgDeliverMode aMode,
|
|||
}
|
||||
else
|
||||
{
|
||||
rv = identity->GetFccFolder(&uri);
|
||||
PRBool doFcc = PR_FALSE;
|
||||
rv = identity->GetDoFcc(&doFcc);
|
||||
if (doFcc)
|
||||
rv = identity->GetFccFolder(&uri);
|
||||
else
|
||||
uri = PL_strdup("");
|
||||
}
|
||||
|
||||
return uri;
|
||||
|
|
|
@ -65,8 +65,8 @@ ComposeGetStringByID(PRInt32 stringID)
|
|||
|
||||
if (NS_FAILED(res))
|
||||
{
|
||||
resultString = "[StringID";
|
||||
resultString.Append(stringID, 10);
|
||||
resultString = "[StringID(hex)=";
|
||||
resultString.Append(stringID, 16);
|
||||
resultString += "?]";
|
||||
return resultString.ToNewUnicode();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#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_FOLDER NS_MSG_GENERATE_FAILURE(12506)
|
||||
#define NS_MSG_COULDNT_OPEN_FCC_FOLDER 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)
|
||||
|
@ -52,13 +52,14 @@
|
|||
#define SMTP_MESSAGE_SENT_WAITING_MAIL_REPLY NS_MSG_GENERATE_SUCCESS(12522)
|
||||
#define SMTP_PROGRESS_MAILSENT NS_MSG_GENERATE_SUCCESS(12523)
|
||||
#define NS_ERROR_SMTP_SERVER_ERROR NS_MSG_GENERATE_FAILURE(12524)
|
||||
#define NS_MSG_UNABLE_TO_SEND_LATER NS_MSG_GENERATE_FAILURE(12525)
|
||||
#define NS_ERROR_COMMUNICATIONS_ERROR NS_MSG_GENERATE_FAILURE(12526)
|
||||
#define NS_ERROR_BUT_DONT_SHOW_ALERT NS_MSG_GENERATE_FAILURE(12527)
|
||||
#define NS_ERROR_TCP_READ_ERROR NS_MSG_GENERATE_FAILURE(12528)
|
||||
#define NS_MSG_UNABLE_TO_SEND_LATER NS_MSG_GENERATE_FAILURE(12525)
|
||||
#define NS_ERROR_COMMUNICATIONS_ERROR NS_MSG_GENERATE_FAILURE(12526)
|
||||
#define NS_ERROR_BUT_DONT_SHOW_ALERT NS_MSG_GENERATE_FAILURE(12527)
|
||||
#define NS_ERROR_TCP_READ_ERROR NS_MSG_GENERATE_FAILURE(12528)
|
||||
#define NS_ERROR_COULD_NOT_GET_USERS_MAIL_ADDRESS NS_MSG_GENERATE_FAILURE(12529)
|
||||
#define NS_ERROR_POP3_PASSWORD_UNDEFINED NS_MSG_GENERATE_FAILURE(12530)
|
||||
#define NS_ERROR_POP3_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)
|
||||
|
||||
NS_BEGIN_EXTERN_C
|
||||
|
||||
|
|
|
@ -2754,8 +2754,15 @@ nsMsgComposeAndSend::DoFcc()
|
|||
// If we hit here, the copy operation FAILED and we should at least tell the
|
||||
// user that it did fail but the send operation has already succeeded.
|
||||
//
|
||||
PRUnichar *eMsg = ComposeGetStringByID(rv);
|
||||
Fail(rv, eMsg);
|
||||
PRBool oopsGiveMeBackTheComposeWindow = PR_FALSE;
|
||||
|
||||
PRUnichar *eMsg = ComposeGetStringByID(NS_MSG_FAILED_COPY_OPERATION);
|
||||
Fail(NS_ERROR_BUT_DONT_SHOW_ALERT, eMsg);
|
||||
|
||||
nsMsgAskBooleanQuestionByString(eMsg, &oopsGiveMeBackTheComposeWindow);
|
||||
if (!oopsGiveMeBackTheComposeWindow)
|
||||
rv = NS_OK;
|
||||
|
||||
NotifyListenersOnStopCopy(rv);
|
||||
nsCRT::free(eMsg);
|
||||
}
|
||||
|
@ -3390,9 +3397,11 @@ nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *input_file,
|
|||
// First, we we need to put a Berkeley "From - " delimiter at the head of
|
||||
// the file for parsing...
|
||||
//
|
||||
turi = GetFolderURIFromUserPrefs(mode, mUserIdentity);
|
||||
if (mode == nsMsgDeliverNow && fcc_header)
|
||||
turi = PL_strdup(fcc_header);
|
||||
else
|
||||
turi = GetFolderURIFromUserPrefs(mode, mUserIdentity);
|
||||
status = MessageFolderIsLocal(mUserIdentity, mode, turi, &folderIsLocal);
|
||||
PR_FREEIF(turi);
|
||||
if (NS_FAILED(status)) { goto FAIL; }
|
||||
|
||||
if ( (envelopeLine) && (folderIsLocal) )
|
||||
|
@ -3649,18 +3658,15 @@ FAIL:
|
|||
// If we weren't successful, then we should just return the error and
|
||||
// bail out.
|
||||
//
|
||||
if (NS_FAILED(status))
|
||||
if (NS_SUCCEEDED(status))
|
||||
{
|
||||
// Fail, and return...
|
||||
return status;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// If we are here, time to start the async copy service operation!
|
||||
//
|
||||
return StartMessageCopyOperation(mCopyFileSpec, mode);
|
||||
//
|
||||
// If we are here, time to start the async copy service operation!
|
||||
//
|
||||
status = StartMessageCopyOperation(mCopyFileSpec, mode, turi);
|
||||
}
|
||||
PR_FREEIF(turi);
|
||||
return status;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -3669,7 +3675,8 @@ FAIL:
|
|||
//
|
||||
nsresult
|
||||
nsMsgComposeAndSend::StartMessageCopyOperation(nsIFileSpec *aFileSpec,
|
||||
nsMsgDeliverMode mode)
|
||||
nsMsgDeliverMode mode,
|
||||
char *dest_uri)
|
||||
{
|
||||
char *uri = nsnull;
|
||||
|
||||
|
@ -3683,7 +3690,10 @@ nsMsgComposeAndSend::StartMessageCopyOperation(nsIFileSpec *aFileSpec,
|
|||
//
|
||||
nsresult rv;
|
||||
|
||||
uri = GetFolderURIFromUserPrefs(mode, mUserIdentity);
|
||||
if (dest_uri && *dest_uri)
|
||||
uri = PL_strdup(dest_uri);
|
||||
else
|
||||
uri = GetFolderURIFromUserPrefs(mode, mUserIdentity);
|
||||
rv = mCopyObj->StartCopyOperation(mUserIdentity, aFileSpec, mode,
|
||||
this, uri, mMsgToReplace);
|
||||
PR_FREEIF(uri);
|
||||
|
|
|
@ -194,7 +194,8 @@ public:
|
|||
|
||||
nsresult DoFcc();
|
||||
nsresult StartMessageCopyOperation(nsIFileSpec *aFileSpec,
|
||||
nsMsgDeliverMode mode);
|
||||
nsMsgDeliverMode mode,
|
||||
char *dest_uri);
|
||||
|
||||
void Clear();
|
||||
void Fail(nsresult failure_code, const PRUnichar * error_msg);
|
||||
|
|
|
@ -112,3 +112,6 @@
|
|||
|
||||
## @name NS_ERROR_MIME_MPART_ATTACHMENT_ERROR
|
||||
12531=Attachment error.
|
||||
|
||||
## @name NS_MSG_FAILED_COPY_OPERATION
|
||||
12532=Your Send operation was successful, but copying the message to your Sent folder failed. Would you like to return to the compose window?
|
||||
|
|
Загрузка…
Ссылка в новой задаче