Backout 969a3a5cb50f (Bug 1240327) for xpcshell crashes.
--HG-- extra : rebase_source : b4772ac0cb27a5dd24de81e252406c5d5ae67396
This commit is contained in:
Родитель
9173f89f79
Коммит
6f85c2675b
|
@ -30,7 +30,7 @@ typedef long nsMsgBiffState;
|
|||
// enumerated type for determining if a message has been replied to, forwarded, etc.
|
||||
typedef long nsMsgDispositionState;
|
||||
|
||||
[scriptable, uuid(5d253ba2-42aa-43a7-b584-0059855ababf)]
|
||||
[scriptable, uuid(E6CC0770-D0D8-4E67-8A2E-02C82C32C99A)]
|
||||
interface nsIMsgFolder : nsISupports {
|
||||
|
||||
const nsMsgBiffState nsMsgBiffState_NewMail = 0; // User has new mail waiting.
|
||||
|
@ -831,10 +831,4 @@ interface nsIMsgFolder : nsISupports {
|
|||
* as the pluggable store for the server.
|
||||
*/
|
||||
readonly attribute nsIMsgPluggableStore msgStore;
|
||||
|
||||
/**
|
||||
* Protocol type, i.e. "pop3", "imap", "nntp", "none", etc
|
||||
* used to construct URLs for this account type.
|
||||
*/
|
||||
readonly attribute ACString incomingServerType;
|
||||
};
|
||||
|
|
|
@ -5941,14 +5941,6 @@ NS_IMETHODIMP nsMsgDBFolder::AndProcessingFlags(nsMsgKey aKey, uint32_t mask)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// Each implementation must provide an override of this, connecting the folder
|
||||
// type to the corresponding incoming server type.
|
||||
NS_IMETHODIMP nsMsgDBFolder::GetIncomingServerType(nsACString& aIncomingServerType)
|
||||
{
|
||||
NS_ASSERTION(false, "subclasses need to override this");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void nsMsgDBFolder::ClearProcessingFlags()
|
||||
{
|
||||
for (uint32_t i = 0; i < nsMsgProcessingFlags::NumberOfFlags; i++)
|
||||
|
|
|
@ -85,6 +85,12 @@ public:
|
|||
protected:
|
||||
virtual ~nsMsgDBFolder();
|
||||
|
||||
// this is a little helper function that is not part of the public interface.
|
||||
// we use it to get the IID of the incoming server for the derived folder.
|
||||
// w/out a function like this we would have to implement GetServer in each
|
||||
// derived folder class.
|
||||
virtual void GetIncomingServerType(nsCString& serverType) = 0;
|
||||
|
||||
virtual nsresult CreateBaseMessageURI(const nsACString& aURI);
|
||||
|
||||
void compressQuotesInMsgSnippet(const nsString& aMessageText, nsAString& aCompressedQuotesStr);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIMsgAttachment.idl',
|
||||
'nsIMsgAttachmentHandler.idl',
|
||||
'nsIMsgCompFields.idl',
|
||||
'nsIMsgCompose.idl',
|
||||
'nsIMsgComposeParams.idl',
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
interface nsIFile;
|
||||
|
||||
// This interface provides minimal XPCONNECT access to objects of type
|
||||
// nsMsgAttachmentHandler. This is primarily for use with new account
|
||||
// types and JsAccount, so this is probably not the interface that you
|
||||
// want if you are working with standard account types.
|
||||
|
||||
[scriptable, uuid(1731283c-60fe-4102-a804-622a84cc1a08)]
|
||||
interface nsIMsgAttachmentHandler : nsISupports
|
||||
{
|
||||
/// The real type, once we know it.
|
||||
readonly attribute ACString type;
|
||||
|
||||
/// URI with link to the attachment.
|
||||
readonly attribute ACString uri;
|
||||
|
||||
/// The temp file to which we save it.
|
||||
readonly attribute nsIFile tmpFile;
|
||||
|
||||
/// The name for the headers, if different from the URL.
|
||||
readonly attribute AUTF8String name;
|
||||
|
||||
/// Size of the attachment, in bytes.
|
||||
readonly attribute unsigned long size;
|
||||
|
||||
/// This is for multipart/related Content-ID's.
|
||||
readonly attribute ACString contentId;
|
||||
|
||||
/// True if this should be sent as a link to a file.
|
||||
readonly attribute boolean sendViaCloud;
|
||||
|
||||
/// Name of the character set for the attachment.
|
||||
readonly attribute ACString charset;
|
||||
|
||||
/// The encoding, once we've decided.
|
||||
readonly attribute ACString encoding;
|
||||
|
||||
/// Whether the attachment has been encoded, for example to base64.
|
||||
readonly attribute boolean alreadyEncoded;
|
||||
};
|
|
@ -98,7 +98,7 @@ interface nsIMsgComposeRecyclingListener : nsISupports {
|
|||
void onReopen(in nsIMsgComposeParams params);
|
||||
};
|
||||
|
||||
[scriptable, uuid(d06ca5af-66b5-4a08-961f-5b47e88cee98)]
|
||||
[scriptable, uuid(44596460-2de4-11e4-8c21-0800200c9a66)]
|
||||
interface nsIMsgCompose : nsIMsgSendListener {
|
||||
|
||||
/**
|
||||
|
@ -126,19 +126,6 @@ interface nsIMsgCompose : nsIMsgSendListener {
|
|||
/* ... */
|
||||
void SendMsg(in MSG_DeliverMode deliverMode, in nsIMsgIdentity identity, in string accountKey, in nsIMsgWindow aMsgWindow, in nsIMsgProgress progress);
|
||||
|
||||
/**
|
||||
* After all Compose preparations are complete, send the prepared message to
|
||||
* the server. This exists primarily to allow an override of the sending to
|
||||
* use a non-SMTP method for send.
|
||||
*
|
||||
* @param deliverMode One of the nsIMsgCompDeliverMode values.
|
||||
* @param identity The message identity.
|
||||
* @param accountKey The message account key.
|
||||
*/
|
||||
void sendMsgToServer(in MSG_DeliverMode deliverMode,
|
||||
in nsIMsgIdentity identity,
|
||||
in string accountKey);
|
||||
|
||||
/* ... */
|
||||
void CloseWindow(in boolean reclycleIt);
|
||||
|
||||
|
@ -191,11 +178,8 @@ interface nsIMsgCompose : nsIMsgSendListener {
|
|||
*/
|
||||
boolean checkCharsetConversion(in nsIMsgIdentity identity, out string fallbackCharset);
|
||||
|
||||
/* The message send object. This is created by default to be the SMTP server
|
||||
* in sendMsgToServer, but if that method is overridden, set the actual
|
||||
* value used here.
|
||||
*/
|
||||
attribute nsIMsgSend messageSend;
|
||||
/* the message send object */
|
||||
readonly attribute nsIMsgSend messageSend;
|
||||
|
||||
/*
|
||||
* Clear the messageSend object to break any circular references
|
||||
|
@ -226,10 +210,6 @@ interface nsIMsgCompose : nsIMsgSendListener {
|
|||
*/
|
||||
attribute boolean bodyModified;
|
||||
|
||||
/* The body string is stored as a byte string in comp fields, but is converted to
|
||||
* UTF16 when fetched by GetBody(). Fetch the body without conversion.
|
||||
*/
|
||||
readonly attribute ACString bodyRaw;
|
||||
|
||||
/**
|
||||
* Init the editor THIS USED TO BE [noscript]
|
||||
|
@ -302,13 +282,10 @@ interface nsIMsgCompose : nsIMsgSendListener {
|
|||
/* for easier use of nsIMsgSendListener */
|
||||
void removeMsgSendListener(in nsIMsgSendListener sendListener);
|
||||
|
||||
// Access during mail-set-sender observer if needed, see nsIMsgCompDeliverMode.
|
||||
readonly attribute MSG_DeliverMode deliverMode;
|
||||
|
||||
};
|
||||
|
||||
/* send listener interface */
|
||||
[scriptable, uuid(ad6ee068-b225-47f9-a50e-8e48440282ca)]
|
||||
[uuid(ACC72780-2CEA-11D5-9DAA-BACDEAC1EEFC)]
|
||||
interface nsIMsgComposeSendListener : nsISupports {
|
||||
|
||||
void setMsgCompose(in nsIMsgCompose msgCompose);
|
||||
|
|
|
@ -34,7 +34,6 @@ interface nsIMsgStatusFeedback;
|
|||
interface nsIEditor;
|
||||
interface nsIArray;
|
||||
interface nsISupportsArray;
|
||||
interface nsIMsgAttachmentHandler;
|
||||
|
||||
typedef long nsMsgDeliverMode;
|
||||
|
||||
|
@ -152,7 +151,7 @@ class nsMsgAttachmentHandler;
|
|||
[ptr] native nsMsgAttachedFile(nsMsgAttachedFile);
|
||||
[ptr] native nsMsgAttachmentHandlerArray(nsTArray<RefPtr<nsMsgAttachmentHandler>>);
|
||||
|
||||
[scriptable, uuid(adcea7be-0585-4f43-ab97-f2436ea5e002)]
|
||||
[scriptable, uuid(3fa45021-8174-478f-8c69-f3a8dc3f49fc)]
|
||||
interface nsIMsgSend : nsISupports
|
||||
{
|
||||
//
|
||||
|
@ -370,36 +369,4 @@ interface nsIMsgSend : nsISupports
|
|||
attribute nsresult status;
|
||||
|
||||
attribute nsIMsgComposeSecure cryptoclosure;
|
||||
|
||||
/// Access the local copy of the composition fields.
|
||||
readonly attribute nsIMsgCompFields sendCompFields;
|
||||
|
||||
/// The message body.
|
||||
readonly attribute AString sendBody;
|
||||
|
||||
/// The type of the message body (typically text/plain or text/html).
|
||||
readonly attribute ACString sendBodyType;
|
||||
|
||||
/// The identity to use to send the message.
|
||||
readonly attribute nsIMsgIdentity identity;
|
||||
|
||||
/**
|
||||
* Get a handler for an attachment by its index.
|
||||
* The lifetime of the attachment is dependent on the existence
|
||||
* of the underlying send object, so do not hold onto these
|
||||
* attachment handlers.
|
||||
*
|
||||
* @param index Index used to specify a particular attachment.
|
||||
*
|
||||
* @return Attachment handler with information about the attachment.
|
||||
*/
|
||||
nsIMsgAttachmentHandler getAttachment(in unsigned long index);
|
||||
|
||||
/// The folder name to which the message will be saved,
|
||||
/// used by error reporting.
|
||||
attribute AString savedToFolderName;
|
||||
|
||||
/// Should we deliver this message (versus saving as a file)?
|
||||
attribute boolean dontDeliver;
|
||||
|
||||
};
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
|
||||
EXPORTS += [
|
||||
'nsComposeStrings.h',
|
||||
'nsMsgAttachmentHandler.h',
|
||||
'nsMsgCompFields.h',
|
||||
'nsMsgCompose.h',
|
||||
'nsMsgSend.h',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
|
|
|
@ -154,86 +154,6 @@ nsMsgAttachmentHandler::~nsMsgAttachmentHandler()
|
|||
CleanupTempFile();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsMsgAttachmentHandler, nsIMsgAttachmentHandler)
|
||||
|
||||
// nsIMsgAttachmentHandler implementation.
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetType(nsACString& aType)
|
||||
{
|
||||
aType.Assign(m_type);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetUri(nsACString& aUri)
|
||||
{
|
||||
nsAutoCString turl;
|
||||
if (!mURL)
|
||||
{
|
||||
if (!m_uri.IsEmpty())
|
||||
turl = m_uri;
|
||||
}
|
||||
else
|
||||
mURL->GetSpec(turl);
|
||||
aUri.Assign(turl);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetTmpFile(nsIFile **aTmpFile)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aTmpFile);
|
||||
if (!mTmpFile)
|
||||
return NS_ERROR_FAILURE;
|
||||
NS_ADDREF(*aTmpFile = mTmpFile);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetName(nsACString& aName)
|
||||
{
|
||||
aName.Assign(m_realName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetSize(uint32_t *aSize)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSize);
|
||||
*aSize = m_size;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetContentId(nsACString& aContentId)
|
||||
{
|
||||
aContentId.Assign(m_contentId);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetSendViaCloud(bool* aSendViaCloud)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSendViaCloud);
|
||||
*aSendViaCloud = mSendViaCloud;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetCharset(nsACString& aCharset)
|
||||
{
|
||||
aCharset.Assign(m_charset);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetEncoding(nsACString& aEncoding)
|
||||
{
|
||||
aEncoding.Assign(m_encoding);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgAttachmentHandler::GetAlreadyEncoded(bool* aAlreadyEncoded)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aAlreadyEncoded);
|
||||
*aAlreadyEncoded = m_already_encoded_p;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Local methods.
|
||||
|
||||
void
|
||||
nsMsgAttachmentHandler::CleanupTempFile()
|
||||
{
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsIFileStreams.h"
|
||||
#include "nsIStreamConverter.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIMsgAttachmentHandler.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
|
||||
|
@ -62,14 +61,12 @@ class MimeEncoder;
|
|||
// This is a class that deals with processing remote attachments. It implements
|
||||
// an nsIStreamListener interface to deal with incoming data
|
||||
//
|
||||
class nsMsgAttachmentHandler : public nsIMsgAttachmentHandler
|
||||
class nsMsgAttachmentHandler
|
||||
{
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsMsgAttachmentHandler)
|
||||
|
||||
typedef mozilla::mailnews::MimeEncoder MimeEncoder;
|
||||
public:
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIMSGATTACHMENTHANDLER
|
||||
|
||||
nsMsgAttachmentHandler();
|
||||
public:
|
||||
nsresult SnarfAttachment(nsMsgCompFields *compFields);
|
||||
|
@ -88,7 +85,7 @@ public:
|
|||
void CleanupTempFile();
|
||||
|
||||
private:
|
||||
virtual ~nsMsgAttachmentHandler();
|
||||
~nsMsgAttachmentHandler();
|
||||
|
||||
// use when a message (e.g. original message in a reply) is attached as a rfc822 attachment.
|
||||
nsresult SnarfMsgAttachment(nsMsgCompFields *compFields);
|
||||
|
|
|
@ -78,7 +78,6 @@
|
|||
#include "mozilla/mailnews/MimeHeaderParser.h"
|
||||
#include "nsISelection.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
using namespace mozilla::mailnews;
|
||||
|
||||
|
@ -1039,9 +1038,8 @@ NS_IMETHODIMP nsMsgCompose::RemoveMsgSendListener( nsIMsgSendListener *aMsgSendL
|
|||
return mExternalSendListeners.RemoveElement(aMsgSendListener) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgCompose::SendMsgToServer(MSG_DeliverMode deliverMode, nsIMsgIdentity *identity,
|
||||
const char *accountKey)
|
||||
nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *identity,
|
||||
const char *accountKey)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -1071,24 +1069,7 @@ nsMsgCompose::SendMsgToServer(MSG_DeliverMode deliverMode, nsIMsgIdentity *ident
|
|||
}
|
||||
|
||||
m_compFields->SetOrganization(organization);
|
||||
|
||||
// We need an nsIMsgSend instance to send the message. Allow extensions
|
||||
// to override the default SMTP sender by observing mail-set-sender.
|
||||
mMsgSend = nullptr;
|
||||
mDeliverMode = deliverMode; // save for possible access by observer;
|
||||
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
if (observerService)
|
||||
{
|
||||
observerService->NotifyObservers(
|
||||
NS_ISUPPORTS_CAST(nsIMsgCompose*, this),
|
||||
"mail-set-sender",
|
||||
NS_ConvertUTF8toUTF16(nsDependentCString(accountKey)).get());
|
||||
}
|
||||
if (!mMsgSend)
|
||||
mMsgSend = do_CreateInstance(NS_MSGSEND_CONTRACTID);
|
||||
|
||||
mMsgSend = do_CreateInstance(NS_MSGSEND_CONTRACTID);
|
||||
if (mMsgSend)
|
||||
{
|
||||
nsCString bodyString(m_compFields->GetBody());
|
||||
|
@ -1339,7 +1320,7 @@ NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity
|
|||
// Save the identity being sent for later use.
|
||||
m_identity = identity;
|
||||
|
||||
rv = SendMsgToServer(deliverMode, identity, accountKey);
|
||||
rv = _SendMsg(deliverMode, identity, accountKey);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
nsCOMPtr<nsIMsgSendReport> sendReport;
|
||||
|
@ -1586,12 +1567,6 @@ NS_IMETHODIMP nsMsgCompose::InitEditor(nsIEditor* aEditor, nsIDOMWindow* aConten
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompose::GetBodyRaw(nsACString& aBodyRaw)
|
||||
{
|
||||
aBodyRaw.Assign((char *)m_compFields->GetBody());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMsgCompose::GetBodyModified(bool * modified)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -2140,12 +2115,6 @@ NS_IMETHODIMP nsMsgCompose::GetMessageSend(nsIMsgSend **_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompose::SetMessageSend(nsIMsgSend* aMsgSend)
|
||||
{
|
||||
mMsgSend = aMsgSend;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompose::ClearMessageSend()
|
||||
{
|
||||
mMsgSend = nullptr;
|
||||
|
@ -5505,13 +5474,6 @@ NS_IMETHODIMP nsMsgCompose::CheckCharsetConversion(nsIMsgIdentity *identity, cha
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompose::GetDeliverMode(MSG_DeliverMode* aDeliverMode)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDeliverMode);
|
||||
*aDeliverMode = mDeliverMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsMsgMailList::nsMsgMailList(nsIAbDirectory* directory) :
|
||||
mDirectory(directory)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ class nsMsgCompose : public nsIMsgCompose, public nsSupportsWeakReference
|
|||
/* nsIMsgSendListener interface */
|
||||
NS_DECL_NSIMSGSENDLISTENER
|
||||
|
||||
protected:
|
||||
private:
|
||||
virtual ~nsMsgCompose();
|
||||
|
||||
// Deal with quoting issues...
|
||||
|
@ -76,7 +76,8 @@ protected:
|
|||
void InsertDivWrappedTextAtSelection(const nsAString &aText,
|
||||
const nsAString &classStr);
|
||||
|
||||
protected:
|
||||
private:
|
||||
nsresult _SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *identity, const char *accountKey);
|
||||
nsresult CreateMessage(const char * originalMsgURI, MSG_ComposeType type, nsIMsgCompFields* compFields);
|
||||
void CleanUpRecipients(nsString& recipients);
|
||||
nsresult GetABDirectories(const nsACString& aDirUri,
|
||||
|
@ -131,8 +132,7 @@ protected:
|
|||
nsTObserverArray<nsCOMPtr<nsIMsgSendListener> > mExternalSendListeners;
|
||||
|
||||
bool mInsertingQuotedContent;
|
||||
MSG_DeliverMode mDeliverMode; // nsIMsgCompDeliverMode long.
|
||||
|
||||
|
||||
friend class QuotingOutputStreamListener;
|
||||
friend class nsMsgComposeSendListener;
|
||||
};
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
#include "mozilla/mailnews/MimeHeaderParser.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsIMsgFilterService.h"
|
||||
#include "nsIMsgProtocolInfo.h"
|
||||
|
||||
using namespace mozilla::mailnews;
|
||||
|
||||
|
@ -204,10 +203,10 @@ class MsgDeliveryListener : public nsIUrlListener
|
|||
{
|
||||
public:
|
||||
MsgDeliveryListener(nsIMsgSend *aMsgSend, bool inIsNewsDelivery);
|
||||
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIURLLISTENER
|
||||
|
||||
|
||||
private:
|
||||
virtual ~MsgDeliveryListener();
|
||||
nsCOMPtr<nsIMsgSend> mMsgSend;
|
||||
|
@ -230,12 +229,12 @@ NS_IMETHODIMP MsgDeliveryListener::OnStartRunningUrl(nsIURI *url)
|
|||
{
|
||||
if (mMsgSend)
|
||||
mMsgSend->NotifyListenerOnStartSending(nullptr, 0);
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP MsgDeliveryListener::OnStopRunningUrl(nsIURI *url, nsresult aExitCode)
|
||||
{
|
||||
{
|
||||
if (url)
|
||||
{
|
||||
nsCOMPtr<nsIMsgMailNewsUrl> mailUrl = do_QueryInterface(url);
|
||||
|
@ -247,14 +246,13 @@ NS_IMETHODIMP MsgDeliveryListener::OnStopRunningUrl(nsIURI *url, nsresult aExitC
|
|||
// the messages than we do.
|
||||
if (mMsgSend)
|
||||
mMsgSend->SendDeliveryCallback(url, mIsNewsDelivery, aExitCode);
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/* the following macro actually implement addref, release and query interface for our component. */
|
||||
NS_IMPL_ISUPPORTS(nsMsgComposeAndSend, nsIMsgSend, nsIMsgOperationListener,
|
||||
nsISupportsWeakReference)
|
||||
NS_IMPL_ISUPPORTS(nsMsgComposeAndSend, nsIMsgSend, nsIMsgOperationListener)
|
||||
|
||||
nsMsgComposeAndSend::nsMsgComposeAndSend() :
|
||||
m_messageKey(nsMsgKey_None)
|
||||
|
@ -1792,29 +1790,11 @@ nsMsgComposeAndSend::ProcessMultipartRelated(int32_t *aMailboxCount, int32_t *aN
|
|||
nsIURI *uri = m_attachments[i]->mURL;
|
||||
bool match = false;
|
||||
if ((NS_SUCCEEDED(uri->SchemeIs("mailbox", &match)) && match) ||
|
||||
(NS_SUCCEEDED(uri->SchemeIs("imap", &match)) && match))
|
||||
(NS_SUCCEEDED(uri->SchemeIs("imap", &match)) && match))
|
||||
(*aMailboxCount)++;
|
||||
else if ((NS_SUCCEEDED(uri->SchemeIs("news", &match)) && match) ||
|
||||
(NS_SUCCEEDED(uri->SchemeIs("snews", &match)) && match))
|
||||
(NS_SUCCEEDED(uri->SchemeIs("snews", &match)) && match))
|
||||
(*aNewsCount)++;
|
||||
else
|
||||
{
|
||||
// Additional account types need a mechanism to report that they are
|
||||
// message protocols. If there is an nsIMsgProtocolInfo component
|
||||
// registered for this scheme, we'll consider it a mailbox
|
||||
// attachment.
|
||||
nsAutoCString contractID;
|
||||
contractID.Assign(
|
||||
NS_LITERAL_CSTRING("@mozilla.org/messenger/protocol/info;1"));
|
||||
nsAutoCString scheme;
|
||||
uri->GetScheme(scheme);
|
||||
contractID.Append(scheme);
|
||||
nsCOMPtr<nsIMsgProtocolInfo> msgProtocolInfo =
|
||||
do_CreateInstance(contractID.get());
|
||||
if (msgProtocolInfo)
|
||||
(*aMailboxCount)++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2200,14 +2180,9 @@ nsMsgComposeAndSend::AddCompFieldRemoteAttachments(uint32_t aStartLocation,
|
|||
// the right thing.
|
||||
if (! nsMsgIsLocalFile(url.get()))
|
||||
{
|
||||
// Check for message attachment, see nsMsgMailNewsUrl::GetIsMessageUri.
|
||||
nsCOMPtr<nsIURI> nsiuri = do_CreateInstance(NS_STANDARDURL_CONTRACTID);
|
||||
NS_ENSURE_STATE(nsiuri);
|
||||
nsiuri->SetSpec(url);
|
||||
nsAutoCString scheme;
|
||||
nsiuri->GetScheme(scheme);
|
||||
bool isAMessageAttachment =
|
||||
StringEndsWith(scheme, NS_LITERAL_CSTRING("-message"));
|
||||
bool isAMessageAttachment = !PL_strncasecmp(url.get(), "mailbox-message://", 18) ||
|
||||
!PL_strncasecmp(url.get(), "imap-message://", 15) ||
|
||||
!PL_strncasecmp(url.get(), "news-message://", 15);
|
||||
|
||||
m_attachments[newLoc]->mDeleteFile = true;
|
||||
m_attachments[newLoc]->m_done = false;
|
||||
|
@ -2435,35 +2410,19 @@ nsMsgComposeAndSend::HackAttachments(nsIArray *attachments,
|
|||
|
||||
/* Count up attachments which are going to come from mail folders
|
||||
and from NNTP servers. */
|
||||
if (m_attachments[i]->mURL)
|
||||
{
|
||||
nsIURI *uri = m_attachments[i]->mURL;
|
||||
bool match = false;
|
||||
if ((NS_SUCCEEDED(uri->SchemeIs("mailbox", &match)) && match) ||
|
||||
(NS_SUCCEEDED(uri->SchemeIs("imap", &match)) && match))
|
||||
mailbox_count++;
|
||||
else if ((NS_SUCCEEDED(uri->SchemeIs("news", &match)) && match) ||
|
||||
(NS_SUCCEEDED(uri->SchemeIs("snews", &match)) && match))
|
||||
news_count++;
|
||||
else
|
||||
{
|
||||
// Additional account types need a mechanism to report that they are
|
||||
// message protocols. If there is an nsIMsgProtocolInfo component
|
||||
// registered for this scheme, we'll consider it a mailbox
|
||||
// attachment.
|
||||
nsAutoCString contractID;
|
||||
contractID.Assign(
|
||||
NS_LITERAL_CSTRING("@mozilla.org/messenger/protocol/info;1"));
|
||||
nsAutoCString scheme;
|
||||
uri->GetScheme(scheme);
|
||||
contractID.Append(scheme);
|
||||
nsCOMPtr<nsIMsgProtocolInfo> msgProtocolInfo =
|
||||
do_CreateInstance(contractID.get());
|
||||
if (msgProtocolInfo)
|
||||
mailbox_count++;
|
||||
}
|
||||
if (uri)
|
||||
msg_pick_real_name(m_attachments[i], nullptr, mCompFields->GetCharacterSet());
|
||||
if (m_attachments[i]->mURL)
|
||||
{
|
||||
nsIURI *uri = m_attachments[i]->mURL;
|
||||
bool match = false;
|
||||
if ((NS_SUCCEEDED(uri->SchemeIs("mailbox", &match)) && match) ||
|
||||
(NS_SUCCEEDED(uri->SchemeIs("imap", &match)) && match))
|
||||
mailbox_count++;
|
||||
else if ((NS_SUCCEEDED(uri->SchemeIs("news", &match)) && match) ||
|
||||
(NS_SUCCEEDED(uri->SchemeIs("snews", &match)) && match))
|
||||
news_count++;
|
||||
|
||||
if (uri)
|
||||
msg_pick_real_name(m_attachments[i], nullptr, mCompFields->GetCharacterSet());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3176,7 +3135,7 @@ NS_IMETHODIMP nsMsgComposeAndSend::SendDeliveryCallback(nsIURI *aUrl, bool inIsN
|
|||
}
|
||||
DeliverAsMailExit(aUrl, aExitCode);
|
||||
}
|
||||
|
||||
|
||||
return aExitCode;
|
||||
}
|
||||
|
||||
|
@ -3273,7 +3232,7 @@ nsMsgComposeAndSend::DeliverFileAsMail()
|
|||
NotifyListenerOnStopSending(nullptr, NS_ERROR_OUT_OF_MEMORY, nullptr, nullptr);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
bool collectOutgoingAddresses = true;
|
||||
nsCOMPtr<nsIPrefBranch> pPrefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (pPrefBranch)
|
||||
|
@ -3318,21 +3277,21 @@ nsMsgComposeAndSend::DeliverFileAsMail()
|
|||
{
|
||||
PL_strcat (buf2, mCompFields->GetTo());
|
||||
if (addressCollector)
|
||||
addressCollector->CollectAddress(nsCString(mCompFields->GetTo()),
|
||||
addressCollector->CollectAddress(nsCString(mCompFields->GetTo()),
|
||||
collectAddresses /* create card if one doesn't exist */, sendFormat);
|
||||
}
|
||||
if (mCompFields->GetCc() && *mCompFields->GetCc()) {
|
||||
if (*buf2) PL_strcat (buf2, ",");
|
||||
PL_strcat (buf2, mCompFields->GetCc());
|
||||
if (addressCollector)
|
||||
addressCollector->CollectAddress(nsCString(mCompFields->GetCc()),
|
||||
addressCollector->CollectAddress(nsCString(mCompFields->GetCc()),
|
||||
collectAddresses /* create card if one doesn't exist */, sendFormat);
|
||||
}
|
||||
if (mCompFields->GetBcc() && *mCompFields->GetBcc()) {
|
||||
if (*buf2) PL_strcat (buf2, ",");
|
||||
PL_strcat (buf2, mCompFields->GetBcc());
|
||||
if (addressCollector)
|
||||
addressCollector->CollectAddress(nsCString(mCompFields->GetBcc()),
|
||||
addressCollector->CollectAddress(nsCString(mCompFields->GetBcc()),
|
||||
collectAddresses /* create card if one doesn't exist */, sendFormat);
|
||||
}
|
||||
|
||||
|
@ -4855,82 +4814,6 @@ NS_IMETHODIMP nsMsgComposeAndSend::SetCryptoclosure(nsIMsgComposeSecure * aCrypt
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetSendCompFields(nsIMsgCompFields** aCompFields)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCompFields);
|
||||
nsCOMPtr<nsIMsgCompFields> qiCompFields(mCompFields);
|
||||
NS_ENSURE_STATE(qiCompFields);
|
||||
qiCompFields.forget(aCompFields);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetSendBody(nsAString& aBody)
|
||||
{
|
||||
nsCString charSet;
|
||||
if (mCompFields)
|
||||
mCompFields->GetCharacterSet(getter_Copies(charSet));
|
||||
return ConvertToUnicode(charSet.get(), m_attachment1_body, aBody);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetSendBodyType(nsACString& aBodyType)
|
||||
{
|
||||
if (m_attachment1_type && *m_attachment1_type)
|
||||
aBodyType.Assign(nsDependentCString(m_attachment1_type));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetIdentity(nsIMsgIdentity **aIdentity)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIdentity);
|
||||
*aIdentity = mUserIdentity;
|
||||
NS_IF_ADDREF(*aIdentity);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetAttachment(uint32_t aIndex,
|
||||
nsIMsgAttachmentHandler **aAttachment)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aAttachment);
|
||||
if (aIndex >= m_attachment_count)
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
*aAttachment = m_attachments[aIndex];
|
||||
NS_IF_ADDREF(*aAttachment);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::SetSavedToFolderName(const nsAString& aName)
|
||||
{
|
||||
mSavedToFolderName.Assign(aName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetSavedToFolderName(nsAString& aName)
|
||||
{
|
||||
aName.Assign(mSavedToFolderName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::SetDontDeliver(bool aDontDeliver)
|
||||
{
|
||||
m_dont_deliver_p = aDontDeliver;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgComposeAndSend::GetDontDeliver(bool *aDontDeliver)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDontDeliver);
|
||||
*aDontDeliver = m_dont_deliver_p;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsMsgAttachmentData, nsIMsgAttachmentData)
|
||||
|
||||
nsMsgAttachmentData::nsMsgAttachmentData() : m_size(0), m_isExternalAttachment(0),
|
||||
|
|
|
@ -166,8 +166,7 @@ class MimeEncoder;
|
|||
}
|
||||
|
||||
class nsMsgComposeAndSend : public nsIMsgSend,
|
||||
public nsIMsgOperationListener,
|
||||
public nsSupportsWeakReference
|
||||
public nsIMsgOperationListener
|
||||
{
|
||||
typedef mozilla::mailnews::MimeEncoder MimeEncoder;
|
||||
public:
|
||||
|
@ -372,7 +371,7 @@ public:
|
|||
protected:
|
||||
nsCOMPtr<nsIStringBundle> mComposeBundle;
|
||||
nsresult GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks);
|
||||
|
||||
private:
|
||||
virtual ~nsMsgComposeAndSend();
|
||||
nsresult FilterSentMessage();
|
||||
nsresult MaybePerformSecondFCC(nsresult aStatus);
|
||||
|
|
|
@ -9816,12 +9816,6 @@ NS_IMETHODIMP nsImapMailFolder::GetOfflineFileStream(nsMsgKey msgKey, int64_t *o
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMailFolder::GetIncomingServerType(nsACString& serverType)
|
||||
{
|
||||
serverType.AssignLiteral("imap");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsImapMailFolder::DeleteStoreMessages(nsIArray* aMessages)
|
||||
{
|
||||
// Delete messages for pluggable stores that do not support compaction.
|
||||
|
|
|
@ -322,8 +322,6 @@ public:
|
|||
*/
|
||||
NS_IMETHOD GetOfflineMsgFolder(nsMsgKey msgKey, nsIMsgFolder **aMsgFolder) override;
|
||||
|
||||
NS_IMETHOD GetIncomingServerType(nsACString& serverType) override;
|
||||
|
||||
nsresult AddSubfolderWithPath(nsAString& name, nsIFile *dbPath, nsIMsgFolder **child, bool brandNew = false);
|
||||
nsresult MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
|
||||
nsIMsgDatabase *sourceDB,
|
||||
|
@ -397,6 +395,7 @@ protected:
|
|||
nsresult AddDirectorySeparator(nsIFile *path);
|
||||
nsresult CreateSubFolders(nsIFile *path);
|
||||
nsresult GetDatabase() override;
|
||||
virtual void GetIncomingServerType(nsCString& serverType) override { serverType.AssignLiteral("imap");}
|
||||
|
||||
nsresult GetFolderOwnerUserName(nsACString& userName);
|
||||
nsIMAPNamespace *GetNamespaceForFolder();
|
||||
|
|
|
@ -3084,24 +3084,24 @@ NS_IMETHODIMP nsMsgLocalMailFolder::NotifyDelete()
|
|||
// this method will go away.
|
||||
// sometimes this gets called when we don't have the server yet, so
|
||||
// that's why we're not calling GetServer()
|
||||
NS_IMETHODIMP
|
||||
nsMsgLocalMailFolder::GetIncomingServerType(nsACString& aServerType)
|
||||
void
|
||||
nsMsgLocalMailFolder::GetIncomingServerType(nsCString& aServerType)
|
||||
{
|
||||
nsresult rv;
|
||||
if (mType.IsEmpty())
|
||||
{
|
||||
nsCOMPtr<nsIURL> url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
return;
|
||||
|
||||
rv = url->SetSpec(mURI);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIMsgAccountManager> accountManager =
|
||||
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
// try "none" first
|
||||
|
@ -3137,7 +3137,6 @@ nsMsgLocalMailFolder::GetIncomingServerType(nsACString& aServerType)
|
|||
}
|
||||
}
|
||||
aServerType = mType;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMsgLocalMailFolder::CreateBaseMessageURI(const nsACString& aURI)
|
||||
|
|
|
@ -175,7 +175,6 @@ public:
|
|||
bool *aAsyncResults) override;
|
||||
NS_IMETHOD AddKeywordsToMessages(nsIArray *aMessages, const nsACString& aKeywords) override;
|
||||
NS_IMETHOD RemoveKeywordsFromMessages(nsIArray *aMessages, const nsACString& aKeywords) override;
|
||||
NS_IMETHOD GetIncomingServerType(nsACString& serverType) override;
|
||||
|
||||
protected:
|
||||
virtual ~nsMsgLocalMailFolder();
|
||||
|
@ -223,6 +222,7 @@ protected:
|
|||
nsIMsgWindow *aMsgWindow,
|
||||
nsIMsgFolder *dstFolder,
|
||||
bool isMove);
|
||||
virtual void GetIncomingServerType(nsCString& serverType) override;
|
||||
nsresult InitCopyState(nsISupports* aSupport, nsIArray* messages,
|
||||
bool isMove, nsIMsgCopyServiceListener* listener, nsIMsgWindow *msgWindow, bool isMoveFolder, bool allowUndo);
|
||||
nsresult InitCopyMsgHdrAndFileStream();
|
||||
|
|
|
@ -1889,11 +1889,3 @@ nsMsgNewsFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
|
|||
m_downloadingMultipleMessages = false;
|
||||
return nsMsgDBFolder::OnStopRunningUrl(aUrl, aExitCode);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgNewsFolder::GetIncomingServerType(nsACString& serverType)
|
||||
{
|
||||
serverType.AssignLiteral("nntp");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,6 @@ public:
|
|||
NS_IMETHOD SetFilterList(nsIMsgFilterList *aFilterList) override;
|
||||
NS_IMETHOD SetEditableFilterList(nsIMsgFilterList *aFilterList) override;
|
||||
NS_IMETHOD ApplyRetentionSettings() override;
|
||||
NS_IMETHOD GetIncomingServerType(nsACString& serverType) override;
|
||||
|
||||
protected:
|
||||
virtual ~nsMsgNewsFolder();
|
||||
|
@ -110,6 +109,10 @@ protected:
|
|||
nsresult GetNewsMessages(nsIMsgWindow *aMsgWindow, bool getOld, nsIUrlListener *aListener);
|
||||
|
||||
int32_t HandleNewsrcLine(const char * line, uint32_t line_size);
|
||||
virtual void GetIncomingServerType(nsCString& serverType) override
|
||||
{
|
||||
serverType.AssignLiteral("nntp");
|
||||
}
|
||||
virtual nsresult CreateBaseMessageURI(const nsACString& aURI) override;
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче