存草稿处理流程
提示信息合并,只弹一个对话框,如果在线存草稿不成功,是否可存离线草稿
goDoCommand('cmd_saveDefault')
MsgComposeCommands.js
cmd_saveDefault: {
isEnabled: function() {
return !gWindowLocked;
},
doCommand: function() {
Save();
}
},
function Save()
{
switch (defaultSaveOperation)
{
case "file" : SaveAsFile(false); break;
case "template" : SaveAsTemplate(false);break;
case "send" : SaveAsSend(false);break;
default : SaveAsDraft(false); break;
}
}
GenericSendMessage_Ori(nsIMsgCompDeliverMode.SaveAsDraft);
{
var progress = Components.classes["@mozilla.org/messenger/progress;1"]
.createInstance(Components.interfaces.nsIMsgProgress);
if (progress)
{
//alert("1 registerListener");
progress.registerListener(progressListener);
gSendOrSaveOperationInProgress = true;
}
gMsgCompose.SendMsg(msgType, getCurrentIdentity(),
getCurrentAccountKey(), msgWindow, progress);
}
nsMsgComposeAndSend::SendToMagicFolder(nsMsgDeliverMode mode)
{
nsresult rv = MimeDoFCC(mTempFile,
mode,
mCompFields->GetBcc(),
mCompFields->GetFcc(),
mCompFields->GetNewspostUrl(),
mCompFields->GetSendName());
if (NS_FAILED(rv))
rv = NotifyListenerOnStopCopy(rv);
}
MimeDoFCC(nsIFile *input_file,...
{
//nscopy.tmp
}
nsMsgComposeAndSend::NotifyListenerOnStopCopy(nsresult aStatus)
{
mComposeBundle->GetStringFromID(NS_MSG_START_COPY_MESSAGE_FAILED, getter_Copies(msg));
#ifdef PR_LOGGING
nsAutoString tempString1(msg.get());
char * utf8String1 = ToNewUTF8String(tempString1);
PR_LOG(gnsMsgSendLog, PR_LOG_ALWAYS,("NotifyListenerOnStopCopy msg:%s[%s:%d-%s]",utf8String1,__FILE__, __LINE__,__FUNCTION__));
#endif
SetStatusMessage(msg); //复制失败。---- 进度条上显示的内容
if (NS_SUCCEEDED(rv))
{
#ifdef PR_LOGGING
nsAutoString tempString(msg.get());
char * utf8String = ToNewUTF8String(tempString);
PR_LOG(gnsMsgSendLog, PR_LOG_ALWAYS,("NotifyListenerOnStopCopy msg2:%s[%s:%d-%s]",utf8String,__FILE__, __LINE__,__FUNCTION__));
#endif
nsMsgDisplayMessageByString(prompt, msg.get(), nullptr); //保存邮件到 草稿箱 时出错 ----中间弹出的提示窗口,没有失败原因
} nsMsgCompose::NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_Del...)
{
rv = _SendMsg(deliverMode, identity, accountKey, entityConversionDone);
if (NS_FAILED(rv))
{
}
nsMsgCompose::_SendMsg(int deliverMode, nsIMsgIdentity * identity, const char * accountKey, bool entityConversionDone)
nsMsgComposeAndSend::CreateAndSendMessage(nsIEditor * aEditor, nsIMsgIdentity * aUserIdentity, const char * aAccou
nsMsgComposeAndSend::Init(nsIMsgIdentity * aUserIdentity, const char * aAccountKey, nsMsgCompFields
nsMsgComposeAndSend::HackAttachments(nsIArray * attachments, nsIArray * preloadedAttachments)
nsMsgComposeAndSend::GatherMimeAttachments()nsMsgComposeAndSend::DeliverMessage(){
if (shouldDeleteDeliveryState)
{
if (NS_FAILED(status))
{
m_status = status;
nsresult ignoreMe;
Fail (status, nullptr, &ignoreMe);
}
}
}
nsMsgComposeAndSend::SendToMagicFolder(int mode)
nsMsgComposeAndSend::MimeDoFCC(nsIFile * input_file, int mode, const char * bcc_header, const char * fcc_header, const char * news_url, const char * custom_url)
nsMsgComposeAndSend::NotifyListenerOnStopCopy(unsigned int aStatus)
{
else if (NS_FAILED(aStatus))
{
//
// If we hit here, the ASYNC copy operation FAILED and we should at least tell the
// user that it did fail but the send operation has already succeeded. This only if
// we are sending the message and not just saving it!
Fail(aStatus, nullptr, &aStatus);
}
}
nsMsgComposeAndSend::Fail(nsresult failure_code, const PRUnichar * error_msg, nsresult *_retval)
{
// 当发生错误的时候,如果是保存草稿出现错误,不显示displayReport 防止窗口的弹出内容:(邮件保存为草稿失败,请验证帐户设置信息并重试。请确认您的邮件帐户设置是否正确,然后重试)
if (m_deliver_mode != nsMsgSaveAsDraft)
mSendReport->DisplayReport(prompt, true, true, _retval);
}
页:
[1]