landing changes for MDN Return Receipts feature, bug #16241
feature contributed by our friend jt95070@netscape.net (Jeff Tsai) r=sspitzer,sr=bienvenu,a=asa. Parts not written by jefft, r=jefft,sr=bienvenu.
This commit is contained in:
Родитель
6e682c8882
Коммит
5f9f54b81c
|
@ -72,7 +72,11 @@
|
|||
<outlinercell url="chrome://messenger/content/pref-labels.xul" label="&labels.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
<outlineritem>
|
||||
<outlinerrow>
|
||||
<outlinercell url="chrome://messenger/content/pref-receipts.xul" label="&return.label;"/>
|
||||
</outlinerrow>
|
||||
</outlineritem> </outlinerchildren>
|
||||
</outlineritem>
|
||||
</outlinerchildren>
|
||||
|
||||
|
|
|
@ -39,3 +39,4 @@ nsIMsgPrintEngine.idl
|
|||
nsIMsgProgress.idl
|
||||
nsIMsgDBView.idl
|
||||
nsIMessengerOSIntegration.idl
|
||||
nsIMsgMdnGenerator.idl
|
||||
|
|
|
@ -78,6 +78,7 @@ XPIDLSRCS = \
|
|||
nsIMsgOfflineManager.idl \
|
||||
nsIMsgProgress.idl \
|
||||
nsIMessengerOSIntegration.idl \
|
||||
nsIMsgMdnGenerator.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE=msgbase
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIMessenger.idl \
|
||||
.\nsICopyMsgStreamListener.idl \
|
||||
.\nsICopyMessageListener.idl \
|
||||
.\nsIFolder.idl \
|
||||
.\nsIFolderListener.idl \
|
||||
.\nsIMsgAccount.idl \
|
||||
.\nsIMsgAccountManager.idl \
|
||||
.\nsIMessengerMigrator.idl \
|
||||
.\nsIMessengerWindowService.idl \
|
||||
.\nsIMsgFolder.idl \
|
||||
.\nsIMsgFolderCache.idl \
|
||||
.\nsIMsgFolderCacheElement.idl \
|
||||
.\nsIMsgFolderCompactor.idl \
|
||||
.\nsIMsgGroupRecord.idl \
|
||||
.\nsIMsgHost.idl \
|
||||
.\nsIMsgIdentity.idl \
|
||||
.\nsIMsgIncomingServer.idl \
|
||||
.\nsIMsgMailSession.idl \
|
||||
.\nsIMsgMessageService.idl \
|
||||
.\nsIMsgSignature.idl \
|
||||
.\nsIMsgThread.idl \
|
||||
.\nsIMsgVCard.idl \
|
||||
.\nsIUrlListener.idl \
|
||||
.\nsIMsgBiffManager.idl \
|
||||
.\nsIMsgCopyService.idl \
|
||||
.\nsIMsgCopyServiceListener.idl \
|
||||
.\nsIUrlListenerManager.idl \
|
||||
.\nsIMsgStatusFeedback.idl \
|
||||
.\nsIMsgMailNewsUrl.idl \
|
||||
.\nsIMsgWindow.idl \
|
||||
.\nsIMsgProtocolInfo.idl \
|
||||
.\nsIMsgRDFDataSource.idl \
|
||||
.\nsIIncomingServerListener.idl \
|
||||
.\nsIMsgHdr.idl \
|
||||
.\nsIMsgStringService.idl \
|
||||
.\nsIMsgPrintEngine.idl \
|
||||
.\nsISubscribableServer.idl \
|
||||
.\nsIMsgDBView.idl \
|
||||
.\nsIMsgOfflineManager.idl \
|
||||
.\nsIMsgProgress.idl \
|
||||
.\nsIMessengerOSIntegration.idl \
|
||||
$(NULL)
|
||||
|
||||
################################################################################
|
||||
## exports
|
||||
|
||||
EXPORTS = \
|
||||
msgCore.h \
|
||||
nsMsgFolderFlags.h \
|
||||
nsMsgHeaderMasks.h \
|
||||
nsMsgLocalFolderHdrs.h \
|
||||
nsMsgMessageFlags.h \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
|
@ -140,6 +140,11 @@ interface nsIMsgAccountManager : nsISupports {
|
|||
*/
|
||||
nsISupportsArray GetIdentitiesForServer(in nsIMsgIncomingServer server);
|
||||
|
||||
/**
|
||||
* given a server, return the first identity in accounts that have this server
|
||||
*/
|
||||
nsIMsgIdentity getFirstIdentityForServer(in nsIMsgIncomingServer server);
|
||||
|
||||
/* given an identity, return all servers in accounts that have
|
||||
* this identity
|
||||
* returns an array of nsIMsgIncomingServer
|
||||
|
|
|
@ -237,7 +237,7 @@ interface nsIMsgIncomingServer : nsISupports {
|
|||
readonly attribute boolean downloadMessagesAtStartup;
|
||||
|
||||
/* check to this if the server supports filters */
|
||||
attribute boolean canHaveFilters;
|
||||
readonly attribute boolean canHaveFilters;
|
||||
|
||||
/**
|
||||
* can this server be removed from the account manager? for
|
||||
|
@ -344,6 +344,18 @@ interface nsIMsgIncomingServer : nsISupports {
|
|||
* manager, set the password member variable.
|
||||
*/
|
||||
readonly attribute boolean isAuthenticated;
|
||||
|
||||
/**
|
||||
* If we have set up to filter return receipts into
|
||||
* our Sent folder, this utility method creates
|
||||
* a filter to do that, and adds it to our filterList
|
||||
* if it doesn't exist. If it does, it will enable it.
|
||||
*
|
||||
* If the user changes their prefs, to leave the
|
||||
* return receipt in the inbox, this will disable
|
||||
* the existing return receipts filter, if it exists.
|
||||
*/
|
||||
void configureTemporaryReturnReceiptsFilter(in nsIMsgFilterList filterList);
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
|
|
@ -47,6 +47,7 @@ interface nsILoadGroup;
|
|||
interface nsIMsgSearchSession;
|
||||
interface nsICacheEntryDescriptor;
|
||||
interface nsICacheSession;
|
||||
interface nsIMimeHeaders;
|
||||
[scriptable, uuid(6CFFCEB0-CB8C-11d2-8065-006008128C4E)]
|
||||
interface nsIMsgMailNewsUrl : nsIURL {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -74,6 +75,9 @@ interface nsIMsgMailNewsUrl : nsIURL {
|
|||
|
||||
attribute nsIMsgWindow msgWindow;
|
||||
|
||||
// current mime headers if reading message
|
||||
attribute nsIMimeHeaders mimeHeaders;
|
||||
|
||||
// the load group is computed from the msgWindow
|
||||
readonly attribute nsILoadGroup loadGroup;
|
||||
|
||||
|
|
|
@ -47,6 +47,13 @@ interface nsOutputStream;
|
|||
[scriptable, uuid(605db0f8-04a1-11d3-a50a-0060b0fc04b7)]
|
||||
interface nsIMsgFilter : nsISupports {
|
||||
readonly attribute nsMsgFilterTypeType filterType;
|
||||
/**
|
||||
* some filters are "temporary". For example, the filters we create when the user
|
||||
* filters return receipts to the Sent folder.
|
||||
* we don't show temporary filters in the UI
|
||||
* and we don't write them to disk.
|
||||
*/
|
||||
attribute boolean temporary;
|
||||
attribute boolean enabled;
|
||||
attribute wstring filterName;
|
||||
attribute string filterDesc;
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
//---------------------------------------------------------------------------
|
||||
// nsMsgSearchTerm specifies one criterion, e.g. name contains phil
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// perhaps this should go in its own header file, if this class gets
|
||||
// its own cpp file, nsMsgSearchTerm.cpp
|
||||
#include "nsIMsgSearchSession.h"
|
||||
#include "nsIMsgSearchScopeTerm.h"
|
||||
#include "nsIMsgSearchTerm.h"
|
||||
|
@ -54,9 +51,6 @@ class nsMsgSearchTerm : public nsIMsgSearchTerm
|
|||
{
|
||||
public:
|
||||
nsMsgSearchTerm();
|
||||
#if 0
|
||||
nsMsgSearchTerm (nsMsgSearchAttribute, nsMsgSearchOperator, nsIMsgSearchValue *, PRBool, char * arbitraryHeader); // the bool is true if AND, PR_FALSE if OR
|
||||
#endif
|
||||
nsMsgSearchTerm (nsMsgSearchAttribValue, nsMsgSearchOpValue, nsIMsgSearchValue *, nsMsgSearchBooleanOperator, const char * arbitraryHeader);
|
||||
|
||||
virtual ~nsMsgSearchTerm ();
|
||||
|
|
|
@ -66,13 +66,13 @@ nsMsgRuleAction::~nsMsgRuleAction()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
nsMsgFilter::nsMsgFilter() :
|
||||
nsMsgFilter::nsMsgFilter():
|
||||
m_type(1),
|
||||
m_temporary(PR_FALSE),
|
||||
m_filterList(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_NewISupportsArray(getter_AddRefs(m_termList));
|
||||
NS_NewISupportsArray(getter_AddRefs(m_termList));
|
||||
}
|
||||
|
||||
nsMsgFilter::~nsMsgFilter()
|
||||
|
@ -83,53 +83,60 @@ NS_IMPL_ISUPPORTS1(nsMsgFilter, nsIMsgFilter)
|
|||
|
||||
NS_IMETHODIMP nsMsgFilter::GetFilterType(nsMsgFilterTypeType *aResult)
|
||||
{
|
||||
if (aResult == NULL)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = m_type;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::GetEnabled(PRBool *aResult)
|
||||
{
|
||||
if (aResult == NULL)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = m_enabled;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::SetEnabled(PRBool enabled)
|
||||
{
|
||||
m_enabled=enabled;
|
||||
return NS_OK;
|
||||
m_enabled = enabled;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::GetTemporary(PRBool *aTemporary)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aTemporary);
|
||||
*aTemporary = m_temporary;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::SetTemporary(PRBool aTemporary)
|
||||
{
|
||||
m_temporary = aTemporary;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::GetFilterName(PRUnichar **name)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(name);
|
||||
|
||||
*name = ToNewUnicode(m_filterName);
|
||||
NS_ENSURE_ARG_POINTER(name);
|
||||
*name = ToNewUnicode(m_filterName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::SetFilterName(const PRUnichar *name)
|
||||
{
|
||||
m_filterName.Assign(name);
|
||||
m_filterName.Assign(name);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::GetFilterDesc(char **description)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(description);
|
||||
|
||||
*description = ToNewCString(m_description);
|
||||
NS_ENSURE_ARG_POINTER(description);
|
||||
*description = ToNewCString(m_description);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::SetFilterDesc(const char *description)
|
||||
{
|
||||
m_description.Assign(description);
|
||||
m_description.Assign(description);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -157,7 +164,7 @@ nsMsgFilter::CreateTerm(nsIMsgSearchTerm **aResult)
|
|||
{
|
||||
nsMsgSearchTerm *term = new nsMsgSearchTerm;
|
||||
NS_ENSURE_TRUE(term, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
|
||||
*aResult = NS_STATIC_CAST(nsIMsgSearchTerm*,term);
|
||||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
|
@ -184,19 +191,18 @@ NS_IMETHODIMP nsMsgFilter::GetTerm(PRInt32 termIndex,
|
|||
term->GetValue(value);
|
||||
if(booleanAnd)
|
||||
term->GetBooleanAnd(booleanAnd);
|
||||
if (attrib && arbitraryHeader)
|
||||
if (attrib && arbitraryHeader) {
|
||||
if (*attrib > nsMsgSearchAttrib::OtherHeader && *attrib < nsMsgSearchAttrib::kNumMsgSearchAttributes)
|
||||
term->GetArbitraryHeader(arbitraryHeader);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFilter::GetSearchTerms(nsISupportsArray **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = m_termList;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
NS_IF_ADDREF(*aResult = m_termList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -209,9 +215,7 @@ NS_IMETHODIMP nsMsgFilter::SetScope(nsIMsgSearchScopeTerm *aResult)
|
|||
NS_IMETHODIMP nsMsgFilter::GetScope(nsIMsgSearchScopeTerm **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = m_scope;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
NS_IF_ADDREF(*aResult = m_scope);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -392,8 +396,7 @@ nsresult
|
|||
nsMsgFilter::GetFilterList(nsIMsgFilterList **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = m_filterList;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
NS_IF_ADDREF(*aResult = m_filterList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ public:
|
|||
nsresult SaveRule(nsIOFileStream *aStream);
|
||||
|
||||
PRInt16 GetVersion();
|
||||
void SetDontFileMe(PRBool bDontFileMe) {m_dontFileMe = bDontFileMe;}
|
||||
#ifdef DEBUG
|
||||
void Dump();
|
||||
#endif
|
||||
|
@ -98,13 +97,14 @@ static nsMsgRuleActionType GetActionForFilingStr(nsCString &actionStr);
|
|||
nsMsgRuleAction m_action;
|
||||
protected:
|
||||
nsMsgFilterTypeType m_type;
|
||||
PRBool m_enabled;
|
||||
nsString m_filterName;
|
||||
nsCString m_scriptFileName; // iff this filter is a script.
|
||||
nsCString m_description;
|
||||
PRBool m_dontFileMe;
|
||||
|
||||
nsIMsgFilterList *m_filterList; /* owning filter list */
|
||||
PRPackedBool m_enabled;
|
||||
PRPackedBool m_temporary;
|
||||
|
||||
nsIMsgFilterList *m_filterList; /* owning filter list */
|
||||
nsCOMPtr<nsISupportsArray> m_termList; /* linked list of criteria terms */
|
||||
nsCOMPtr<nsIMsgSearchScopeTerm> m_scope; /* default for mail rules is inbox, but news rules could
|
||||
have a newsgroup - LDAP would be invalid */
|
||||
|
|
|
@ -321,6 +321,12 @@ nsMsgFilterDataSource::getFilterListTargets(nsIMsgFilterList *aFilterList,
|
|||
rv = aFilterList->GetFilterAt(i, getter_AddRefs(filter));
|
||||
if (NS_FAILED(rv)) continue;
|
||||
|
||||
PRBool isTemporary;
|
||||
rv = filter->GetTemporary(&isTemporary);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "GetTemporary() failed");
|
||||
if (isTemporary)
|
||||
continue;
|
||||
|
||||
nsXPIDLString filterName;
|
||||
rv = filter->GetFilterName(getter_Copies(filterName));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
|
|
@ -726,8 +726,15 @@ nsresult nsMsgFilterList::SaveTextFilters(nsIOFileStream *aStream)
|
|||
if (GetMsgFilterAt(i, &filter) == NS_OK && filter != nsnull)
|
||||
{
|
||||
filter->SetFilterList(this);
|
||||
if ((err = filter->SaveToTextFile(aStream)) != NS_OK)
|
||||
break;
|
||||
|
||||
// if the filter is temporary, don't write it to disk
|
||||
PRBool isTemporary;
|
||||
err = filter->GetTemporary(&isTemporary);
|
||||
if (NS_SUCCEEDED(err) && !isTemporary) {
|
||||
if ((err = filter->SaveToTextFile(aStream)) != NS_OK)
|
||||
break;
|
||||
}
|
||||
|
||||
NS_RELEASE(filter);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -649,7 +649,16 @@ nsresult nsMsgSearchOfflineMail::MatchTerms(nsIMsgDBHdr *msgToMatch,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
if ( attrib > nsMsgSearchAttrib::OtherHeader && attrib < nsMsgSearchAttrib::kNumMsgSearchAttributes)
|
||||
// XXX todo
|
||||
// for the temporary return receipts filters, we use a custom header for Content-Type
|
||||
// but unlike the other custom headers, this one doesn't show up in the search / filter
|
||||
// UI. we set the attrib to be nsMsgSearchAttrib::OtherHeader, where as for user
|
||||
// defined custom headers start at nsMsgSearchAttrib::OtherHeader + 1
|
||||
// Not sure if there is a better way to do this yet. Maybe reserve the last
|
||||
// custom header for ::Content-Type? But if we do, make sure that change
|
||||
// doesn't cause nsMsgFilter::GetTerm() to change, and start making us
|
||||
// ask IMAP servers for the Content-Type header on all messages.
|
||||
if ( attrib >= nsMsgSearchAttrib::OtherHeader && attrib < nsMsgSearchAttrib::kNumMsgSearchAttributes)
|
||||
{
|
||||
PRUint32 lineCount;
|
||||
msgToMatch->GetLineCount(&lineCount);
|
||||
|
|
|
@ -1110,7 +1110,7 @@ nsMsgSearchValidityManager::NewTable(nsIMsgSearchValidityTable **aTable)
|
|||
nsresult
|
||||
nsMsgSearchValidityManager::InitOtherHeadersInTable (nsIMsgSearchValidityTable *aTable, const char *customHeaders)
|
||||
{
|
||||
PRUint32 customHeadersLength = PL_strlen(customHeaders);
|
||||
PRUint32 customHeadersLength = strlen(customHeaders);
|
||||
PRUint32 numHeaders=0;
|
||||
PRUint32 i=0;
|
||||
if (customHeadersLength)
|
||||
|
|
|
@ -291,25 +291,6 @@ nsMsgSearchTerm::nsMsgSearchTerm()
|
|||
m_value.u.priority=0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
nsMsgSearchTerm::nsMsgSearchTerm (
|
||||
nsMsgSearchAttribute attrib,
|
||||
nsMsgSearchOperator op,
|
||||
nsMsgSearchValue *val,
|
||||
PRBool booleanAND,
|
||||
char * arbitraryHeader)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
m_operator = op;
|
||||
m_booleanOp = (booleanAND) ? nsMsgSearchBooleanOp::BooleanAND : nsMsgSearchBooleanOp::BooleanOR;
|
||||
if (attrib > nsMsgSearchAttrib::OtherHeader && attrib < nsMsgSearchAttrib::kNumMsgSearchAttributes && arbitraryHeader)
|
||||
m_arbitraryHeader = arbitraryHeader;
|
||||
m_attribute = attrib;
|
||||
|
||||
nsMsgResultElement::AssignValues (val, &m_value);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsMsgSearchTerm::nsMsgSearchTerm (
|
||||
nsMsgSearchAttribValue attrib,
|
||||
nsMsgSearchOpValue op,
|
||||
|
@ -1321,8 +1302,7 @@ NS_IMPL_ISUPPORTS1(nsMsgSearchScopeTerm, nsIMsgSearchScopeTerm)
|
|||
NS_IMETHODIMP
|
||||
nsMsgSearchScopeTerm::GetFolder(nsIMsgFolder **aResult)
|
||||
{
|
||||
*aResult = m_folder;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
NS_IF_ADDREF(*aResult = m_folder);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1331,8 +1311,7 @@ nsMsgSearchScopeTerm::GetSearchSession(nsIMsgSearchSession** aResult)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
nsCOMPtr<nsIMsgSearchSession> searchSession = do_QueryReferent (m_searchSession);
|
||||
*aResult = searchSession;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
NS_IF_ADDREF(*aResult = searchSession);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1876,6 +1876,24 @@ nsMsgAccountManager::findServer(nsISupports *aElement, void *data)
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgAccountManager::GetFirstIdentityForServer(nsIMsgIncomingServer *aServer, nsIMsgIdentity **aIdentity)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aServer);
|
||||
NS_ENSURE_ARG_POINTER(aIdentity);
|
||||
|
||||
nsCOMPtr<nsISupportsArray> identities;
|
||||
nsresult rv = GetIdentitiesForServer(aServer, getter_AddRefs(identities));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgIdentity> identity;
|
||||
rv = identities->QueryElementAt(0, NS_GET_IID(nsIMsgIdentity),
|
||||
(void **)getter_AddRefs(identity));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_IF_ADDREF(*aIdentity = identity);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgAccountManager::GetIdentitiesForServer(nsIMsgIncomingServer *server,
|
||||
nsISupportsArray **_retval)
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#include "nsMsgDatabase.h"
|
||||
#include "nsIDBFolderInfo.h"
|
||||
#include "nsIMsgAccountManager.h"
|
||||
#include "nsIMsgIdentity.h"
|
||||
#include "nsMsgBaseCID.h"
|
||||
#include "nsMsgUtils.h" // for NS_MsgHashIfNecessary()
|
||||
#include "nsMsgI18N.h"
|
||||
|
@ -78,6 +77,7 @@
|
|||
#include "nsILocale.h"
|
||||
#include "nsILocaleService.h"
|
||||
#include "nsCollationCID.h"
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
|
||||
#define PREF_MAIL_WARN_FILTER_CHANGED "mail.warn_filter_changed"
|
||||
|
||||
|
@ -259,6 +259,7 @@ nsMsgFolder::createCollationKeyGenerator()
|
|||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgFolder::Init(const char* aURI)
|
||||
{
|
||||
|
@ -1527,30 +1528,19 @@ NS_IMETHODIMP nsMsgFolder::SetPrefFlag()
|
|||
// folders later on on the imap server, the subsequent GetResouce() of the
|
||||
// same uri will get us the cached rdf resouce which should have the folder
|
||||
// flag set appropriately.
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIMsgAccountManager> accountManager =
|
||||
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
|
||||
|
||||
if(NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIMsgAccountManager> accountMgr = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
rv = GetServer(getter_AddRefs(server));
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsISupportsArray> identities;
|
||||
rv = accountManager->GetIdentitiesForServer(server,
|
||||
getter_AddRefs(identities));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgIdentity> identity;
|
||||
|
||||
rv = identities->QueryElementAt(0, NS_GET_IID(nsIMsgIdentity),
|
||||
(void **)getter_AddRefs(identity));
|
||||
|
||||
rv = accountMgr->GetFirstIdentityForServer(server, getter_AddRefs(identity));
|
||||
if (NS_SUCCEEDED(rv) && identity)
|
||||
{
|
||||
nsXPIDLCString folderUri;
|
||||
|
|
|
@ -75,10 +75,8 @@
|
|||
|
||||
#include "nsIMsgAccountManager.h"
|
||||
#include "nsCPasswordManager.h"
|
||||
|
||||
#ifdef DEBUG_sspitzer
|
||||
#define DEBUG_MSGINCOMING_SERVER
|
||||
#endif /* DEBUG_sspitzer */
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
#include "nsMsgFolderFlags.h"
|
||||
|
||||
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
|
@ -239,14 +237,6 @@ nsMsgIncomingServer::GetCanHaveFilters(PRBool *canHaveFilters)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgIncomingServer::SetCanHaveFilters(PRBool canHaveFilters)
|
||||
{
|
||||
// derived class should override if they need to do this.
|
||||
m_canHaveFilters = canHaveFilters;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgIncomingServer::GetCanBeDefaultServer(PRBool *canBeDefaultServer)
|
||||
{
|
||||
|
@ -1077,8 +1067,7 @@ nsMsgIncomingServer::GetFilterList(nsIMsgWindow *aMsgWindow, nsIMsgFilterList **
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
*aResult = mFilterList;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
NS_IF_ADDREF(*aResult = mFilterList);
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
@ -1660,3 +1649,121 @@ nsMsgIncomingServer::GetIsAuthenticated(PRBool *isAuthenticated)
|
|||
*isAuthenticated = !m_password.IsEmpty();
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgIncomingServer::ConfigureTemporaryReturnReceiptsFilter(nsIMsgFilterList *filterList)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(filterList);
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIMsgAccountManager> accountMgr = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgIdentity> identity;
|
||||
rv = accountMgr->GetFirstIdentityForServer(this, getter_AddRefs(identity));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool useCustomPrefs = PR_FALSE;
|
||||
PRInt32 incorp = nsIMsgMdnGenerator::eIncorporateInbox;
|
||||
|
||||
identity->GetBoolAttribute("use_custom_prefs", &useCustomPrefs);
|
||||
if (useCustomPrefs)
|
||||
rv = GetIntValue("incorporate_return_receipt", &incorp);
|
||||
else
|
||||
{
|
||||
nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch;
|
||||
rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = prefBranch->GetIntPref("mail.incorporate.return_receipt", &incorp);
|
||||
}
|
||||
|
||||
PRBool enable = (incorp == nsIMsgMdnGenerator::eIncorporateSent);
|
||||
|
||||
// this is a temporary, internal mozilla filter
|
||||
// it will not show up in the UI, it will not be written to disk
|
||||
NS_NAMED_LITERAL_STRING(internalReturnReceiptFilterName, "mozilla-temporary-internal-MDN-receipt-filter");
|
||||
|
||||
nsCOMPtr<nsIMsgFilter> newFilter;
|
||||
rv = filterList->GetFilterNamed(internalReturnReceiptFilterName.get(),
|
||||
getter_AddRefs(newFilter));
|
||||
if (newFilter)
|
||||
newFilter->SetEnabled(enable);
|
||||
else if (enable)
|
||||
{
|
||||
nsCOMPtr<nsIMsgFolder> rootFolder;
|
||||
rv = GetRootMsgFolder(getter_AddRefs(rootFolder));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRUint32 numFolders;
|
||||
nsCOMPtr<nsIMsgFolder> sentFolder;
|
||||
|
||||
rootFolder->GetFoldersWithFlag(MSG_FOLDER_FLAG_SENTMAIL, 1,
|
||||
&numFolders,
|
||||
getter_AddRefs(sentFolder));
|
||||
if (sentFolder)
|
||||
{
|
||||
filterList->CreateFilter(internalReturnReceiptFilterName.get(),
|
||||
getter_AddRefs(newFilter));
|
||||
if (newFilter)
|
||||
{
|
||||
newFilter->SetEnabled(PR_TRUE);
|
||||
// this internal filter is temporary
|
||||
// and should not show up in the UI or be written to disk
|
||||
newFilter->SetTemporary(PR_TRUE);
|
||||
|
||||
nsCOMPtr<nsIMsgSearchTerm> term;
|
||||
nsCOMPtr<nsIMsgSearchValue> value;
|
||||
|
||||
rv = newFilter->CreateTerm(getter_AddRefs(term));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
rv = term->GetValue(getter_AddRefs(value));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
// XXX todo
|
||||
// determine if ::OtherHeader is the best way to do this.
|
||||
// see nsMsgSearchOfflineMail::MatchTerms()
|
||||
value->SetAttrib(nsMsgSearchAttrib::OtherHeader);
|
||||
value->SetStr(NS_LITERAL_STRING("multipart/report").get());
|
||||
term->SetAttrib(nsMsgSearchAttrib::OtherHeader);
|
||||
term->SetOp(nsMsgSearchOp::Contains);
|
||||
term->SetBooleanAnd(PR_TRUE);
|
||||
term->SetArbitraryHeader("Content-Type");
|
||||
term->SetValue(value);
|
||||
newFilter->AppendTerm(term);
|
||||
}
|
||||
}
|
||||
rv = newFilter->CreateTerm(getter_AddRefs(term));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
rv = term->GetValue(getter_AddRefs(value));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
// XXX todo
|
||||
// determine if ::OtherHeader is the best way to do this.
|
||||
// see nsMsgSearchOfflineMail::MatchTerms()
|
||||
value->SetAttrib(nsMsgSearchAttrib::OtherHeader);
|
||||
value->SetStr(NS_LITERAL_STRING("disposition-notification").get());
|
||||
term->SetAttrib(nsMsgSearchAttrib::OtherHeader);
|
||||
term->SetOp(nsMsgSearchOp::Contains);
|
||||
term->SetBooleanAnd(PR_TRUE);
|
||||
term->SetArbitraryHeader("Content-Type");
|
||||
term->SetValue(value);
|
||||
newFilter->AppendTerm(term);
|
||||
}
|
||||
}
|
||||
newFilter->SetAction(nsMsgFilterAction::MoveToFolder);
|
||||
nsXPIDLCString actionTargetFolderUri;
|
||||
rv = sentFolder->GetURI(getter_Copies(actionTargetFolderUri));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
newFilter->SetActionTargetFolderUri(actionTargetFolderUri);
|
||||
filterList->InsertFilterAt(0, newFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -788,3 +788,16 @@ NS_IMETHODIMP nsMsgMailNewsUrl:: RemoveCacheEntry(nsICacheEntryDescriptor *cache
|
|||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMailNewsUrl::GetMimeHeaders(nsIMimeHeaders * *mimeHeaders)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(mimeHeaders);
|
||||
NS_IF_ADDREF(*mimeHeaders = mMimeHeaders);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMailNewsUrl::SetMimeHeaders(nsIMimeHeaders *mimeHeaders)
|
||||
{
|
||||
mMimeHeaders = mimeHeaders;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "nsIMsgWindow.h"
|
||||
#include "nsIMsgStatusFeedback.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIMimeHeaders.h"
|
||||
#include "nsIMsgMailNewsUrl.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsILoadGroup.h"
|
||||
|
@ -81,6 +82,7 @@ protected:
|
|||
nsCOMPtr<nsIMsgStatusFeedback> m_statusFeedback;
|
||||
nsCOMPtr<nsIMsgWindow> m_msgWindow;
|
||||
nsCOMPtr<nsILoadGroup> m_loadGroup;
|
||||
nsCOMPtr<nsIMimeHeaders> mMimeHeaders;
|
||||
nsCOMPtr<nsIMsgSearchSession> m_searchSession;
|
||||
nsCOMPtr<nsICacheEntryDescriptor> m_memCacheEntry;
|
||||
nsCOMPtr<nsICacheSession> m_imageCacheSession;
|
||||
|
|
|
@ -1,291 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsMessageCompCID_h__
|
||||
#define nsMessageCompCID_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
//
|
||||
// nsMsgComposeService
|
||||
//
|
||||
#define NS_MSGCOMPOSESERVICE_CID \
|
||||
{ /* 588595FE-1ADA-11d3-A715-0060B0EB39B5 */ \
|
||||
0x588595fe, 0x1ada, 0x11d3, \
|
||||
{0xa7, 0x15, 0x0, 0x60, 0xb0, 0xeb, 0x39, 0xb5}}
|
||||
|
||||
#define NS_MSGCOMPOSESERVICE_CONTRACTID \
|
||||
"@mozilla.org/messengercompose;1"
|
||||
#define NS_MSGCOMPOSESTARTUPHANDLER_CONTRACTID \
|
||||
"@mozilla.org/commandlinehandler/general-startup;1?type=compose"
|
||||
|
||||
//
|
||||
// nsMsgComposeContentHandler
|
||||
//
|
||||
#define NS_MSGCOMPOSECONTENTHANDLER_CID \
|
||||
{ /* 0B63FB80-BBBA-11D4-9DAA-91B657EB313C */ \
|
||||
0x0b63fb80, 0xbbba, 0x11d4, \
|
||||
{0x9d, 0xaa, 0x91, 0xb6, 0x57, 0xeb, 0x31, 0x3c}}
|
||||
|
||||
#define NS_MSGCOMPOSECONTENTHANDLER_CONTRACTID \
|
||||
NS_CONTENT_HANDLER_CONTRACTID_PREFIX"x-application-mailto"
|
||||
|
||||
//
|
||||
// nsMsgCompose
|
||||
//
|
||||
#define NS_MSGCOMPOSE_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/compose;1"
|
||||
|
||||
#define NS_MSGCOMPOSE_CID \
|
||||
{ /* EB5BDAF8-BBC6-11d2-A6EC-0060B0EB39B5 */ \
|
||||
0xeb5bdaf8, 0xbbc6, 0x11d2, \
|
||||
{0xa6, 0xec, 0x0, 0x60, 0xb0, 0xeb, 0x39, 0xb5}}
|
||||
|
||||
//
|
||||
// nsMsgComposeSecure
|
||||
//
|
||||
#define NS_MSGCOMPOSESECURE_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/composesecure;1"
|
||||
|
||||
//
|
||||
// nsMsgComposeParams
|
||||
//
|
||||
#define NS_MSGCOMPOSEPARAMS_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/composeparams;1"
|
||||
|
||||
#define NS_MSGCOMPOSEPARAMS_CID \
|
||||
{ /* CB998A00-C079-11D4-9DAA-8DF64BAB2EFC */ \
|
||||
0xcb998a00, 0xc079, 0x11d4, \
|
||||
{0x9d, 0xaa, 0x8d, 0xf6, 0x4b, 0xab, 0x2e, 0xfc}}
|
||||
|
||||
//
|
||||
// nsMsgComposeSendListener
|
||||
//
|
||||
#define NS_MSGCOMPOSESENDLISTENER_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/composesendlistener;1"
|
||||
|
||||
#define NS_MSGCOMPOSESENDLISTENER_CID \
|
||||
{ /* acc72781-2cea-11d5-9daa-bacdeac1eefc */ \
|
||||
0xacc72781, 0x2cea, 0x11d5, \
|
||||
{0x9d, 0xaa, 0xba, 0xcd, 0xea, 0xc1, 0xee, 0xfc}}
|
||||
|
||||
//
|
||||
// nsMsgComposeProgressParams
|
||||
//
|
||||
#define NS_MSGCOMPOSEPROGRESSPARAMS_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/composeprogressparameters;1"
|
||||
|
||||
#define NS_MSGCOMPOSEPROGRESSPARAMS_CID \
|
||||
{ /* 1e0e7c01-3e4c-11d5-9daa-f88d288130fc */ \
|
||||
0x1e0e7c01, 0x3e4c, 0x11d5, \
|
||||
{0x9d, 0xaa, 0xf8, 0x8d, 0x28, 0x81, 0x30, 0xfc}}
|
||||
|
||||
//
|
||||
// nsMsgCompFields
|
||||
//
|
||||
#define NS_MSGCOMPFIELDS_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/composefields;1"
|
||||
|
||||
#define NS_MSGCOMPFIELDS_CID \
|
||||
{ /* 6D222BA0-BD46-11d2-8293-000000000000 */ \
|
||||
0x6d222ba0, 0xbd46, 0x11d2, \
|
||||
{0x82, 0x93, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
|
||||
|
||||
//
|
||||
// nsMsgAttachment
|
||||
//
|
||||
#define NS_MSGATTACHMENT_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/attachment;1"
|
||||
|
||||
#define NS_MSGATTACHMENT_CID \
|
||||
{ /* 27B8D045-8D9F-4fa8-BFB6-8A0F8D09CE89 */ \
|
||||
0x27b8d045, 0x8d9f, 0x4fa8, \
|
||||
{0xbf, 0xb6, 0x8a, 0xf, 0x8d, 0x9, 0xce, 0x89}}
|
||||
|
||||
//
|
||||
// nsMsgSend
|
||||
//
|
||||
#define NS_MSGSEND_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/send;1"
|
||||
|
||||
#define NS_MSGSEND_CID \
|
||||
{ /* 935284E0-C5D8-11d2-8297-000000000000 */ \
|
||||
0x935284e0, 0xc5d8, 0x11d2, \
|
||||
{0x82, 0x97, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
|
||||
|
||||
//
|
||||
// nsMsgSendLater
|
||||
//
|
||||
#define NS_MSGSENDLATER_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/sendlater;1"
|
||||
|
||||
#define NS_MSGSENDLATER_CID \
|
||||
{ /* E15C83F1-1CF4-11d3-8EF0-00A024A7D144 */ \
|
||||
0xe15c83f1, 0x1cf4, 0x11d3, \
|
||||
{0x8e, 0xf0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 }}
|
||||
|
||||
//
|
||||
// nsSmtpUrl
|
||||
//
|
||||
#define NS_SMTPURL_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/smtpurl;1"
|
||||
|
||||
#define NS_SMTPURL_CID \
|
||||
{ /* BE59DBF0-2812-11d3-80A3-006008128C4E} */ \
|
||||
0xbe59dbf0, 0x2812, 0x11d3, \
|
||||
{0x80, 0xa3, 0x0, 0x60, 0x8, 0x12, 0x8c, 0x4e}}
|
||||
|
||||
//
|
||||
// nsMailtoUrl
|
||||
//
|
||||
#define NS_MAILTOURL_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/mailtourl;1"
|
||||
|
||||
#define NS_MAILTOURL_CID \
|
||||
{ /* 05BAB5E7-9C7D-11d3-98A3-001083010E9B} */ \
|
||||
0x5bab5e7, 0x9c7d, 0x11d3, \
|
||||
{0x98, 0xa3, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b}}
|
||||
|
||||
//
|
||||
// nsSmtpServer
|
||||
//
|
||||
#define NS_SMTPSERVER_CONTRACTID \
|
||||
"@mozilla.org/messenger/smtp/server;1"
|
||||
|
||||
#define NS_SMTPSERVER_CID \
|
||||
{ /* 60dc861a-56ce-11d3-9118-00a0c900d445 */ \
|
||||
0x60dc861a,0x56ce,0x11d3, \
|
||||
{0x91,0x18, 0x0, 0xa0, 0xc9, 0x0, 0xd4, 0x45 }}
|
||||
|
||||
//
|
||||
// nsSmtpService
|
||||
//
|
||||
#define NS_SMTPSERVICE_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/smtp;1"
|
||||
|
||||
#define NS_MAILTOHANDLER_CONTRACTID \
|
||||
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "mailto"
|
||||
|
||||
#define NS_SMTPSERVICE_CID \
|
||||
{ /* 5B6419F1-CA9B-11d2-8063-006008128C4E */ \
|
||||
0x5b6419f1, 0xca9b, 0x11d2, \
|
||||
{0x80, 0x63, 0x0, 0x60, 0x8, 0x12, 0x8c, 0x4e}}
|
||||
|
||||
//
|
||||
// nsMsgQuote
|
||||
//
|
||||
#define NS_MSGQUOTE_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/quoting;1"
|
||||
#define NS_MSGQUOTE_CID \
|
||||
{0x1C7ABF0C, 0x21E5, 0x11d3, \
|
||||
{ 0x8E, 0xF1, 0x00, 0xA0, 0x24, 0xA7, 0xD1, 0x44 }}
|
||||
|
||||
#define NS_MSGQUOTELISTENER_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/quotinglistener;1"
|
||||
#define NS_MSGQUOTELISTENER_CID \
|
||||
{0x683728ac, 0x88df, 0x11d3, \
|
||||
{ 0x98, 0x9d, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b }}
|
||||
|
||||
//
|
||||
// nsMsgDraft
|
||||
//
|
||||
#define NS_MSGDRAFT_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/drafts;1"
|
||||
#define NS_MSGDRAFT_CID \
|
||||
{ 0xa623746c, 0x453b, 0x11d3, \
|
||||
{ 0x8f, 0xf, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
|
||||
|
||||
//
|
||||
// nsMsgRecipientArray
|
||||
//
|
||||
#define NS_MSGRECIPIENTARRAY_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/recipientarray;1"
|
||||
#define NS_MSGRECIPIENTARRAY_CID \
|
||||
{0x9d653e00, 0xa1ca, 0x11d3, \
|
||||
{ 0xa4, 0x49, 0xf7, 0x9a, 0xb1, 0xc7, 0xd8, 0xfc }}
|
||||
|
||||
|
||||
// compose string service routines
|
||||
|
||||
/* B51E56BD-FF80-11d3-98BC-001083010E9B */
|
||||
#define NS_MSG_COMPOSESTRINGSERVICE_CID \
|
||||
{ 0xb51e56bd, 0xff80, 0x11d3, \
|
||||
{ 0x98, 0xbc, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
|
||||
|
||||
#define NS_MSG_SMTPSTRINGSERVICE_CONTRACTID \
|
||||
NS_MAILNEWS_STRINGSERVICE_CONTRACTID_PREFIX "smtp"
|
||||
|
||||
#define NS_MSG_COMPOSESTRINGSERVICE_CONTRACTID \
|
||||
NS_MAILNEWS_STRINGSERVICE_CONTRACTID_PREFIX "compose"
|
||||
|
||||
//
|
||||
// nsSmtpDataSource
|
||||
//
|
||||
#define NS_SMTPDATASOURCE_CONTRACTID \
|
||||
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "smtp"
|
||||
|
||||
// {0C612140-25FE-11d4-9A27-0010A4E03656}
|
||||
#define NS_SMTPDATASOURCE_CID \
|
||||
{ 0xc612140, 0x25fe, 0x11d4, \
|
||||
{ 0x9a, 0x27, 0x0, 0x10, 0xa4, 0xe0, 0x36, 0x56 } }
|
||||
|
||||
//
|
||||
// nsSmtpDelegateFactory
|
||||
//
|
||||
#define NS_SMTPDELEGATEFACTORY_CONTRACTID \
|
||||
NS_RDF_DELEGATEFACTORY_CONTRACTID_PREFIX "smtpserver" "&scheme=smtp"
|
||||
|
||||
// {0C612141-25FE-11d4-9A27-0010A4E03656}
|
||||
#define NS_SMTPDELEGATEFACTORY_CID \
|
||||
{ 0xc612141, 0x25fe, 0x11d4, \
|
||||
{ 0x9a, 0x27, 0x0, 0x10, 0xa4, 0xe0, 0x36, 0x56 } }
|
||||
|
||||
//
|
||||
// nsURLFetcher
|
||||
//
|
||||
#define NS_URLFETCHER_CONTRACTID \
|
||||
"@mozilla.org/messengercompose/urlfetcher;1"
|
||||
|
||||
// {01B8A701-2F52-11D5-9DAA-F78DA781A1FC}
|
||||
#define NS_URLFETCHER_CID \
|
||||
{ 0x01b8a701, 0x2f52, 0x11d5, \
|
||||
{ 0x9d, 0xaa, 0xf7, 0x8d, 0xa7, 0x81, 0xa1, 0xfc } }
|
||||
|
||||
|
||||
#endif // nsMessageCompCID_h__
|
|
@ -70,6 +70,7 @@
|
|||
#include "nsIContentHandler.h"
|
||||
#include "nsMsgRecipientArray.h"
|
||||
#include "nsMsgComposeStringBundle.h"
|
||||
#include "nsMsgCompUtils.h"
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpService);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpServer);
|
||||
|
@ -93,6 +94,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsComposeStringService);
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpDataSource);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSmtpDelegateFactory);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsURLFetcher);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgCompUtils);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -202,6 +204,10 @@ static const nsModuleComponentInfo components[] =
|
|||
NS_URLFETCHER_CID,
|
||||
NS_URLFETCHER_CONTRACTID,
|
||||
nsURLFetcherConstructor },
|
||||
{ "Msg Compose Utils",
|
||||
NS_MSGCOMPUTILS_CID,
|
||||
NS_MSGCOMPUTILS_CONTRACTID,
|
||||
nsMsgCompUtilsConstructor },
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ XPIDLSRCS = \
|
|||
nsISmtpService.idl \
|
||||
nsIURLFetcher.idl \
|
||||
nsIMsgComposeSecure.idl \
|
||||
nsIMsgCompUtils.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE=msgcompo
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIMsgAttachment.idl \
|
||||
.\nsIMsgComposeProgressParams.idl \
|
||||
.\nsIMsgComposeParams.idl \
|
||||
.\nsIMsgComposeService.idl \
|
||||
.\nsIMsgCompose.idl \
|
||||
.\nsIMsgCompFields.idl \
|
||||
.\nsIMsgQuote.idl \
|
||||
.\nsIMsgSendListener.idl \
|
||||
.\nsIMsgSendLaterListener.idl \
|
||||
.\nsIMsgSend.idl \
|
||||
.\nsIMsgSendLater.idl \
|
||||
.\nsIMsgSendReport.idl \
|
||||
.\nsIMsgRecipientArray.idl \
|
||||
.\nsIMsgDraft.idl \
|
||||
.\nsISmtpServer.idl \
|
||||
.\nsISmtpUrl.idl \
|
||||
.\nsISmtpService.idl \
|
||||
.\nsIURLFetcher.idl \
|
||||
.\nsIMsgComposeSecure.idl \
|
||||
$(NULL)
|
||||
|
||||
################################################################################
|
||||
## exports
|
||||
|
||||
EXPORTS = \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
|
@ -78,6 +78,7 @@ interface nsIMsgCompFields : nsISupports {
|
|||
attribute string draftId;
|
||||
|
||||
attribute boolean returnReceipt;
|
||||
attribute long receiptHeaderType;
|
||||
attribute boolean attachVCard;
|
||||
attribute boolean forcePlainText;
|
||||
attribute boolean useMultipartAlternative;
|
||||
|
|
|
@ -606,7 +606,6 @@ var defaultController =
|
|||
case "cmd_selectAddress" : if (defaultController.isCommandEnabled(command)) SelectAddress(); break;
|
||||
// case "cmd_quoteMessage" : if (defaultController.isCommandEnabled(command)) QuoteSelectedMessage(); break;
|
||||
case "cmd_rewrap" : editorShell.Rewrap(false); break;
|
||||
|
||||
default:
|
||||
// dump("##MsgCompose: don't know what to do with command " + command + "!\n");
|
||||
return;
|
||||
|
@ -1307,6 +1306,9 @@ function ComposeStartup(recycled, aParams)
|
|||
return;
|
||||
}
|
||||
|
||||
document.getElementById("returnReceiptMenu").setAttribute('checked',
|
||||
gMsgCompose.compFields.returnReceipt);
|
||||
|
||||
if (!recycled) //The editor is already initialized and does not support to be re-initialized.
|
||||
{
|
||||
// save the editorShell in the window. The editor JS expects to find it there.
|
||||
|
@ -1807,25 +1809,6 @@ function PriorityMenuSelect(target)
|
|||
}
|
||||
}
|
||||
|
||||
function ReturnReceiptMenuSelect()
|
||||
{
|
||||
if (gMsgCompose)
|
||||
{
|
||||
var msgCompFields = gMsgCompose.compFields;
|
||||
if (msgCompFields)
|
||||
{
|
||||
if (msgCompFields.returnReceipt)
|
||||
{
|
||||
msgCompFields.returnReceipt = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
msgCompFields.returnReceipt = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OutputFormatMenuSelect(target)
|
||||
{
|
||||
if (gMsgCompose)
|
||||
|
@ -1866,6 +1849,16 @@ function SelectAddress()
|
|||
AdjustFocus();
|
||||
}
|
||||
|
||||
function ToggleReturnReceipt(target)
|
||||
{
|
||||
var msgCompFields = gMsgCompose.compFields;
|
||||
if (msgCompFields)
|
||||
{
|
||||
msgCompFields.returnReceipt = ! msgCompFields.returnReceipt;
|
||||
target.setAttribute('checked', msgCompFields.returnReceipt);
|
||||
}
|
||||
}
|
||||
|
||||
function queryISupportsArray(supportsArray, iid) {
|
||||
var result = new Array;
|
||||
for (var i=0; i<supportsArray.Count(); i++) {
|
||||
|
|
|
@ -290,6 +290,7 @@
|
|||
<!--menuitem label=""eOrigCmd.label;" accesskey=""eOrigCmd.accesskey;" command="cmd_quoteMessage"/-->
|
||||
<menuitem label="&editRewrapCmd.label;" accesskey="&editRewrapCmd.accesskey;" command="cmd_rewrap" oncommand="editorShell.Rewrap(false)"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="returnReceiptMenu" type="checkbox" label="&returnReceiptMenu.label;" accesskey="&returnReceiptMenu.accesskey;" checked="false" oncommand="ToggleReturnReceipt(event.target)"/>
|
||||
<menu id="outputFormatMenu" label="&outputFormatMenu.label;" accesskey="&outputFormatMenu.accesskey;" command="cmd_outputFormat">
|
||||
<menupopup>
|
||||
<menuitem type="radio" name="output_format" label="&autoFormatCmd.label;" accesskey="&autoFormatCmd.accesskey;" id="format_auto" checked="true"/>
|
||||
|
|
|
@ -124,6 +124,8 @@
|
|||
<!ENTITY highestPriorityCmd.label "Highest">
|
||||
<!ENTITY highestPriorityCmd.accesskey "H">
|
||||
|
||||
<!ENTITY returnReceiptMenu.label "Return Receipt">
|
||||
<!ENTITY returnReceiptMenu.accesskey "t">
|
||||
<!ENTITY outputFormatMenu.label "Format">
|
||||
<!ENTITY outputFormatMenu.accesskey "f">
|
||||
<!ENTITY autoFormatCmd.label "Auto-Detect">
|
||||
|
|
|
@ -66,13 +66,10 @@ nsMsgCompFields::nsMsgCompFields()
|
|||
m_useMultipartAlternative = PR_FALSE;
|
||||
m_uuEncodeAttachments = PR_FALSE;
|
||||
m_returnReceipt = PR_FALSE;
|
||||
m_receiptType = 0;
|
||||
|
||||
nsCOMPtr<nsIPref> prefs (do_GetService(NS_PREF_CONTRACTID));
|
||||
if (prefs)
|
||||
{
|
||||
prefs->GetBoolPref("mail.request.return_receipt_on", &m_returnReceipt);
|
||||
prefs->GetIntPref("mail.request.return_receipt", &m_receiptType);
|
||||
// Get the default charset from pref, use this as a mail charset.
|
||||
nsXPIDLString charset;
|
||||
prefs->GetLocalizedUnicharPref("mailnews.send_default_charset", getter_Copies(charset));
|
||||
|
@ -398,6 +395,18 @@ NS_IMETHODIMP nsMsgCompFields::GetReturnReceipt(PRBool *_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompFields::SetReceiptHeaderType(PRInt32 value)
|
||||
{
|
||||
m_receiptHeaderType = value;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompFields::GetReceiptHeaderType(PRInt32 *_retval)
|
||||
{
|
||||
*_retval = m_receiptHeaderType;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompFields::SetAttachVCard(PRBool value)
|
||||
{
|
||||
m_attachVCard = value;
|
||||
|
|
|
@ -166,9 +166,6 @@ public:
|
|||
|
||||
nsresult SplitRecipientsEx(const PRUnichar *recipients, nsIMsgRecipientArray ** fullAddrsArray, nsIMsgRecipientArray ** emailsArray);
|
||||
|
||||
PRInt32 GetReturnReceiptType() { return m_receiptType; };
|
||||
void SetReturnReceiptType(PRInt32 type) {m_receiptType = type;};
|
||||
|
||||
protected:
|
||||
char* m_headers[MSG_MAX_HEADERS];
|
||||
char* m_body;
|
||||
|
@ -178,7 +175,7 @@ protected:
|
|||
PRBool m_useMultipartAlternative;
|
||||
PRBool m_uuEncodeAttachments;
|
||||
PRBool m_returnReceipt;
|
||||
PRInt32 m_receiptType; /* 0:None 1:DSN 2:MDN 3:BOTH */
|
||||
PRInt32 m_receiptHeaderType; /* receipt header type */
|
||||
nsCString m_internalCharSet;
|
||||
nsCString m_DefaultCharacterSet;
|
||||
|
||||
|
|
|
@ -60,10 +60,49 @@
|
|||
#include "nsMsgUtils.h"
|
||||
#include "nsMsgSimulateError.h"
|
||||
|
||||
#include "nsIMsgCompUtils.h"
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
|
||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
static NS_DEFINE_CID(kHTTPHandlerCID, NS_HTTPPROTOCOLHANDLER_CID);
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsMsgCompUtils, nsIMsgCompUtils)
|
||||
|
||||
nsMsgCompUtils::nsMsgCompUtils()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsMsgCompUtils::~nsMsgCompUtils()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompUtils::MimeMakeSeparator(const char *prefix,
|
||||
char **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(prefix);
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = mime_make_separator(prefix);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompUtils::MsgGenerateMessageId(nsIMsgIdentity *identity,
|
||||
char **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(identity);
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = msg_generate_message_id(identity);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgCompUtils::GetMsgMimeConformToStandard(PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = nsMsgMIMEGetConformToStandard();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//
|
||||
// Hopefully, someone will write and XP call like this eventually!
|
||||
//
|
||||
|
@ -336,29 +375,28 @@ mime_generate_headers (nsMsgCompFields *fields,
|
|||
* coorelate the MDN reports to the original message. Here will be
|
||||
* the right place
|
||||
*/
|
||||
|
||||
if (fields->GetReturnReceipt() &&
|
||||
(fields->GetReturnReceiptType() == 2 ||
|
||||
fields->GetReturnReceiptType() == 3) &&
|
||||
(deliver_mode != nsIMsgSend::nsMsgSaveAsDraft &&
|
||||
deliver_mode != nsIMsgSend::nsMsgSaveAsTemplate))
|
||||
{
|
||||
PRInt32 receipt_header_type = 0;
|
||||
PRInt32 receipt_header_type = nsIMsgMdnGenerator::eDntType;
|
||||
fields->GetReceiptHeaderType(&receipt_header_type);
|
||||
|
||||
if (prefs)
|
||||
prefs->GetIntPref("mail.receipt.request_header_type", &receipt_header_type);
|
||||
|
||||
// 0 = MDN Disposition-Notification-To: ; 1 = Return-Receipt-To: ; 2 =
|
||||
// both MDN DNT & RRT headers
|
||||
if (receipt_header_type == 1) {
|
||||
// nsIMsgMdnGenerator::eDntType = MDN Disposition-Notification-To: ;
|
||||
// nsIMsgMdnGenerator::eRrtType = Return-Receipt-To: ;
|
||||
// nsIMsgMdnGenerator::eDntRrtType = both MDN DNT & RRT headers
|
||||
if (receipt_header_type == nsIMsgMdnGenerator::eRrtType) {
|
||||
RRT_HEADER:
|
||||
ENCODE_AND_PUSH("Return-Receipt-To: ", PR_TRUE, pFrom, charset, usemime);
|
||||
}
|
||||
else {
|
||||
ENCODE_AND_PUSH("Disposition-Notification-To: ", PR_TRUE, pFrom, charset, usemime);
|
||||
if (receipt_header_type == 2)
|
||||
if (receipt_header_type == nsIMsgMdnGenerator::eDntRrtType)
|
||||
goto RRT_HEADER;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SUPPORT_X_TEMPLATE_NAME
|
||||
if (deliver_mode == MSG_SaveAsTemplate) {
|
||||
const char *pStr = fields->GetTemplateName();
|
||||
|
@ -415,7 +453,13 @@ RRT_HEADER:
|
|||
PUSH_STRING("vcard=0");
|
||||
PUSH_STRING("; ");
|
||||
if (fields->GetReturnReceipt()) {
|
||||
char *type = PR_smprintf("%d", (int) fields->GetReturnReceiptType());
|
||||
// slight change compared to 4.x; we used to use receipt= to tell
|
||||
// whether the draft/template has request for either MDN or DNS or both
|
||||
// return receipt; since the DNS is out of the picture we now use the
|
||||
// header type + 1 to tell whether user has requested the return receipt
|
||||
PRInt32 headerType = 0;
|
||||
fields->GetReceiptHeaderType(&headerType);
|
||||
char *type = PR_smprintf("%d", (int)headerType + 1);
|
||||
if (type)
|
||||
{
|
||||
PUSH_STRING("receipt=");
|
||||
|
|
|
@ -43,11 +43,22 @@
|
|||
#include "nsFileSpec.h"
|
||||
#include "nsMsgCompFields.h"
|
||||
#include "nsIMsgSend.h"
|
||||
#include "nsIMsgCompUtils.h"
|
||||
|
||||
class nsIPrompt;
|
||||
|
||||
#define ANY_SERVER "anyfolder://"
|
||||
|
||||
class nsMsgCompUtils : public nsIMsgCompUtils
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIMSGCOMPUTILS
|
||||
|
||||
nsMsgCompUtils();
|
||||
virtual ~nsMsgCompUtils();
|
||||
};
|
||||
|
||||
NS_BEGIN_EXTERN_C
|
||||
|
||||
//
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
|
||||
#include "nsMsgBaseCID.h"
|
||||
#include "nsIMsgAccountManager.h"
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
|
||||
#ifdef MSGCOMP_TRACE_PERFORMANCE
|
||||
#include "prlog.h"
|
||||
|
@ -438,6 +439,29 @@ nsMsgComposeService::OpenComposeWindow(const char *msgComposeWindowURL, const ch
|
|||
else
|
||||
pMsgComposeParams->SetOriginalMsgURI(originalMsgURI);
|
||||
|
||||
PRBool requestForReturnReceipt = PR_FALSE;
|
||||
PRBool useCustomPrefs = PR_FALSE;
|
||||
PRInt32 receiptType = nsIMsgMdnGenerator::eDntType;
|
||||
identity->GetBoolAttribute("use_custom_prefs", &useCustomPrefs);
|
||||
if (useCustomPrefs)
|
||||
{
|
||||
identity->GetBoolAttribute("request_return_receipt_on",
|
||||
&requestForReturnReceipt);
|
||||
identity->GetIntAttribute("request_receipt_header_type",
|
||||
&receiptType);
|
||||
}
|
||||
else
|
||||
{
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = prefs->GetBoolPref("mail.receipt.request_return_receipt_on",
|
||||
&requestForReturnReceipt);
|
||||
rv = prefs->GetIntPref("mail.receipt.request_header_type",
|
||||
&receiptType);
|
||||
}
|
||||
pMsgCompFields->SetReturnReceipt(requestForReturnReceipt);
|
||||
pMsgCompFields->SetReceiptHeaderType(receiptType);
|
||||
|
||||
pMsgComposeParams->SetComposeFields(pMsgCompFields);
|
||||
|
||||
if(mLogComposePerformance)
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
#include "nsNetCID.h"
|
||||
#include "nsMsgUtils.h"
|
||||
#include "nsIRDFService.h"
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
|
||||
// use these macros to define a class IID for our component. Our object currently
|
||||
// supports two interfaces (nsISupports and nsIMsgCompose) so we want to define constants
|
||||
|
@ -2803,7 +2804,12 @@ nsMsgComposeAndSend::InitCompositionFields(nsMsgCompFields *fields)
|
|||
mCompFields->SetAttachVCard(fields->GetAttachVCard());
|
||||
mCompFields->SetForcePlainText(fields->GetForcePlainText());
|
||||
mCompFields->SetUseMultipartAlternative(fields->GetUseMultipartAlternative());
|
||||
PRInt32 receiptType = nsIMsgMdnGenerator::eDntType;
|
||||
fields->GetReceiptHeaderType(&receiptType);
|
||||
|
||||
mCompFields->SetReturnReceipt(fields->GetReturnReceipt());
|
||||
mCompFields->SetReceiptHeaderType(receiptType);
|
||||
|
||||
mCompFields->SetUuEncodeAttachments(fields->GetUuEncodeAttachments());
|
||||
|
||||
nsCOMPtr<nsISupports> secInfo;
|
||||
|
|
|
@ -26,12 +26,14 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = mdn
|
||||
|
||||
ifdef MOZ_PSM
|
||||
BUILD_SMIME=1
|
||||
endif
|
||||
|
||||
ifdef BUILD_SMIME
|
||||
DIRS = smime
|
||||
DIRS += smime
|
||||
endif
|
||||
|
||||
ifdef BUILD_MAIL_SMOKETEST
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..
|
||||
|
||||
!if defined(BUILD_PSM2)
|
||||
BUILD_SMIME=1
|
||||
!endif
|
||||
|
||||
!if defined(BUILD_SMIME)
|
||||
DIRS=smime
|
||||
!endif
|
||||
|
||||
!if defined(BUILD_MAIL_SMOKETEST)
|
||||
DIRS=$(DIRS) smoketest
|
||||
!endif
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -1,3 +1,39 @@
|
|||
#***** BEGIN LICENSE BLOCK *****
|
||||
#Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
#The contents of this file are subject to the Mozilla Public License Version
|
||||
#1.1 (the "License"); you may not use this file except in compliance with
|
||||
#the License. You may obtain a copy of the License at
|
||||
#http://www.mozilla.org/MPL/
|
||||
#
|
||||
#Software distributed under the License is distributed on an "AS IS" basis,
|
||||
#WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
#for the specific language governing rights and limitations under the
|
||||
#License.
|
||||
#
|
||||
#The Original Code is mozilla.
|
||||
#
|
||||
#The Initial Developer of the Original Code is
|
||||
# Jeff Tsai <jt95070@netscape.net>.
|
||||
#Portions created by the Initial Developer are Copyright (C) 2002
|
||||
#the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
#Contributor(s):
|
||||
# Seth Spitzer <sspitzer@netscape.com>
|
||||
#
|
||||
#Alternatively, the contents of this file may be used under the terms of
|
||||
#either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
#the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
#in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
#of those above. If you wish to allow use of your version of this file only
|
||||
#under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
#use your version of this file under the terms of the MPL, indicate your
|
||||
#decision by deleting the provisions above and replace them with the notice
|
||||
#and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
#the provisions above, a recipient may use your version of this file under
|
||||
#the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
#***** END LICENSE BLOCK *****
|
||||
## Msg Mdn Report strings
|
||||
MsgMdnDisplayed=Note: This Return Receipt only acknowledges that the message was displayed on the recipient's computer. There is no guarantee that the recipient has read or understood the message contents.
|
||||
MsgMdnDispatched=The message was either printed, faxed, or forwarded without being displayed to the recipient. There is no guarantee that the recipient will read the message at a later time.
|
||||
|
@ -6,7 +42,8 @@ MsgMdnDeleted=The message has been deleted. The person you sent it to may or may
|
|||
MsgMdnDenied=The recipient of the message does not wish to send a return receipt back to you.
|
||||
MsgMdnFailed=A failure occurred. A proper return receipt could not be generated or sent to you.
|
||||
MsgMdnWishToSend=The sender of this message has asked to be notified when you read this message.\nDo you wish to notify the sender?
|
||||
MsgMdnMsgSentTo=This is a Return Receipt for the mail that you sent to %s.
|
||||
# LOCALIZATION NOTE : Do not translate the word "%S" below.
|
||||
MsgMdnMsgSentTo=This is a Return Receipt for the mail that you sent to %S.
|
||||
MdnDisplayedReceipt=Return Receipt (displayed)
|
||||
MdnDispatchedReceipt=Return Receipt (dispatched)
|
||||
MdnProcessedReceipt=Return Receipt (processed)
|
||||
|
|
|
@ -128,10 +128,33 @@ nsMsgMdnGenerator::~nsMsgMdnGenerator()
|
|||
{
|
||||
}
|
||||
|
||||
nsresult nsMsgMdnGenerator::FormatStringFromName(const PRUnichar *aName,
|
||||
const PRUnichar *aString,
|
||||
PRUnichar **aResultString)
|
||||
{
|
||||
DEBUG_MDN("nsMsgMdnGenerator::FormatStringFromName");
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIStringBundleService>
|
||||
bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr <nsIStringBundle> bundle;
|
||||
rv = bundleService->CreateBundle(MDN_STRINGBUNDLE_URL,
|
||||
getter_AddRefs(bundle));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
const PRUnichar *formatStrings[1] = { aString };
|
||||
rv = bundle->FormatStringFromName(aName,
|
||||
formatStrings, 1, aResultString);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsMsgMdnGenerator::GetStringFromName(const PRUnichar *aName,
|
||||
PRUnichar **aResultString)
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::GetStringFromName");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::GetStringFromName");
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIStringBundleService>
|
||||
|
@ -148,25 +171,26 @@ nsresult nsMsgMdnGenerator::GetStringFromName(const PRUnichar *aName,
|
|||
return rv;
|
||||
}
|
||||
|
||||
void nsMsgMdnGenerator::StoreImapMDNSentFlag(nsIMsgFolder *folder,
|
||||
nsresult nsMsgMdnGenerator::StoreMDNSentFlag(nsIMsgFolder *folder,
|
||||
nsMsgKey key)
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::StoreImapMDNSentFlag");
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIMsgImapMailFolder> imapFolder(do_QueryInterface(folder,
|
||||
&rv));
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
DEBUG_MDN("nsMsgMdnGenerator::StoreMDNSentFlag");
|
||||
|
||||
// Store the $MDNSent flag if the folder is an Imap Mail Folder
|
||||
// otherwise, do nothing.
|
||||
nsCOMPtr<nsIMsgImapMailFolder> imapFolder = do_QueryInterface(folder);
|
||||
if (!imapFolder)
|
||||
return NS_OK;
|
||||
|
||||
nsMsgKeyArray keyArray;
|
||||
keyArray.Add(key);
|
||||
imapFolder->StoreImapFlags(kImapMsgMDNSentFlag, PR_TRUE,
|
||||
return imapFolder->StoreImapFlags(kImapMsgMDNSentFlag, PR_TRUE,
|
||||
keyArray.GetArray(), keyArray.GetSize());
|
||||
}
|
||||
|
||||
PRBool nsMsgMdnGenerator::ProcessSendMode()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::ProcessSendMode");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::ProcessSendMode");
|
||||
PRInt32 miscState = 0;
|
||||
|
||||
if (m_identity)
|
||||
|
@ -277,7 +301,7 @@ PRBool nsMsgMdnGenerator::MailAddrMatch(const char *addr1, const char *addr2)
|
|||
// Comparing two email addresses returns true if matched; local/account
|
||||
// part comparison is case sensitive; domain part comparison is case
|
||||
// insensitive
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::MailAddrMatch");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::MailAddrMatch");
|
||||
PRBool isMatched = PR_TRUE;
|
||||
const char *atSign1 = nsnull, *atSign2 = nsnull;
|
||||
const char *lt = nsnull, *local1 = nsnull, *local2 = nsnull;
|
||||
|
@ -313,7 +337,7 @@ PRBool nsMsgMdnGenerator::MailAddrMatch(const char *addr1, const char *addr2)
|
|||
|
||||
PRBool nsMsgMdnGenerator::NotInToOrCc()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::NotInToOrCc");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::NotInToOrCc");
|
||||
nsXPIDLCString reply_to;
|
||||
nsXPIDLCString to;
|
||||
nsXPIDLCString cc;
|
||||
|
@ -337,7 +361,7 @@ PRBool nsMsgMdnGenerator::NotInToOrCc()
|
|||
|
||||
PRBool nsMsgMdnGenerator::ValidateReturnPath()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::ValidateReturnPath");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::ValidateReturnPath");
|
||||
// ValidateReturnPath applies to Automatic Send Mode only. If we were not
|
||||
// in auto send mode we simply by passing the check
|
||||
if (!m_autoSend)
|
||||
|
@ -355,9 +379,9 @@ PRBool nsMsgMdnGenerator::ValidateReturnPath()
|
|||
return m_reallySendMdn;
|
||||
}
|
||||
|
||||
void nsMsgMdnGenerator::CreateMdnMsg()
|
||||
nsresult nsMsgMdnGenerator::CreateMdnMsg()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::CreateMdnMsg");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::CreateMdnMsg");
|
||||
nsresult rv;
|
||||
if (!m_autoSend)
|
||||
{
|
||||
|
@ -379,7 +403,8 @@ void nsMsgMdnGenerator::CreateMdnMsg()
|
|||
}
|
||||
}
|
||||
if (!m_reallySendMdn)
|
||||
return;
|
||||
return NS_OK;
|
||||
|
||||
nsSpecialSystemDirectory
|
||||
tmpFile(nsSpecialSystemDirectory::OS_TemporaryDirectory);
|
||||
tmpFile += "mdnmsg";
|
||||
|
@ -389,11 +414,12 @@ void nsMsgMdnGenerator::CreateMdnMsg()
|
|||
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),"creating mdn: failed to create");
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
return NS_OK;
|
||||
|
||||
rv = m_fileSpec->GetOutputStream(getter_AddRefs(m_outputStream));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),"creating mdn: failed to output stream");
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
return NS_OK;
|
||||
|
||||
rv = CreateFirstPart();
|
||||
if (NS_SUCCEEDED(rv))
|
||||
|
@ -413,15 +439,17 @@ void nsMsgMdnGenerator::CreateMdnMsg()
|
|||
if (NS_FAILED(rv))
|
||||
m_fileSpec->Delete(PR_FALSE);
|
||||
else
|
||||
DoSendMdn();
|
||||
rv = SendMdnMsg();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMsgMdnGenerator::CreateFirstPart()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::CreateFirstPart");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::CreateFirstPart");
|
||||
char *convbuf = nsnull, *tmpBuffer = nsnull;
|
||||
char *parm = nsnull;
|
||||
char *firstPart1 = nsnull;
|
||||
nsXPIDLString firstPart1;
|
||||
nsXPIDLString firstPart2;
|
||||
nsresult rv = NS_OK;
|
||||
nsXPIDLString receipt_string;
|
||||
|
@ -476,14 +504,10 @@ nsresult nsMsgMdnGenerator::CreateFirstPart()
|
|||
conformToStandard);
|
||||
parm = PR_smprintf("From: %s" CRLF, convbuf ? convbuf : m_email.get());
|
||||
|
||||
nsXPIDLString mdnMsgSentTo;
|
||||
rv = GetStringFromName(NS_LITERAL_STRING("MsgMdnMsgSentTo").get(),
|
||||
getter_Copies(mdnMsgSentTo));
|
||||
rv = FormatStringFromName(NS_LITERAL_STRING("MsgMdnMsgSentTo").get(), NS_ConvertASCIItoUCS2(m_email).get(),
|
||||
getter_Copies(firstPart1));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
firstPart1 =
|
||||
PR_smprintf (NS_LossyConvertUCS2toASCII(mdnMsgSentTo).get(),
|
||||
convbuf ? convbuf : m_email.get());
|
||||
|
||||
PUSH_N_FREE_STRING (parm);
|
||||
|
||||
|
@ -600,12 +624,11 @@ report-type=disposition-notification;\r\n\tboundary=\"%s\"" CRLF CRLF,
|
|||
ENCODING_7BIT);
|
||||
PUSH_N_FREE_STRING(tmpBuffer);
|
||||
|
||||
if (firstPart1)
|
||||
if (!firstPart1.IsEmpty())
|
||||
{
|
||||
tmpBuffer = PR_smprintf("%s" CRLF CRLF, firstPart1);
|
||||
tmpBuffer = PR_smprintf("%s" CRLF CRLF, NS_LossyConvertUCS2toASCII(firstPart1).get());
|
||||
PUSH_N_FREE_STRING(tmpBuffer);
|
||||
PR_Free(firstPart1);
|
||||
}
|
||||
}
|
||||
|
||||
switch (m_disposeType)
|
||||
{
|
||||
|
@ -647,7 +670,7 @@ report-type=disposition-notification;\r\n\tboundary=\"%s\"" CRLF CRLF,
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (firstPart2)
|
||||
if (!firstPart2.IsEmpty())
|
||||
{
|
||||
tmpBuffer =
|
||||
PR_smprintf("%s" CRLF CRLF,
|
||||
|
@ -660,7 +683,7 @@ report-type=disposition-notification;\r\n\tboundary=\"%s\"" CRLF CRLF,
|
|||
|
||||
nsresult nsMsgMdnGenerator::CreateSecondPart()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::CreateSecondPart");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::CreateSecondPart");
|
||||
char *tmpBuffer = nsnull;
|
||||
char *convbuf = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -738,7 +761,7 @@ nsresult nsMsgMdnGenerator::CreateSecondPart()
|
|||
|
||||
nsresult nsMsgMdnGenerator::CreateThirdPart()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::CreateThirdPart");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::CreateThirdPart");
|
||||
char *tmpBuffer = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -772,7 +795,7 @@ nsresult nsMsgMdnGenerator::CreateThirdPart()
|
|||
|
||||
nsresult nsMsgMdnGenerator::OutputAllHeaders()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::OutputAllHeaders");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::OutputAllHeaders");
|
||||
nsXPIDLCString all_headers;
|
||||
PRInt32 all_headers_size = 0;
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -854,19 +877,19 @@ nsresult nsMsgMdnGenerator::OutputAllHeaders()
|
|||
return count;
|
||||
}
|
||||
|
||||
void nsMsgMdnGenerator::DoSendMdn()
|
||||
nsresult nsMsgMdnGenerator::SendMdnMsg()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::DoSendMdn");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::SendMdnMsg");
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsISmtpService>
|
||||
smtpService(do_GetService(NS_SMTPSERVICE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(rv) && smtpService)
|
||||
{
|
||||
nsCOMPtr<nsIRequest> aRequest;
|
||||
smtpService->SendMailMessage(m_fileSpec, m_dntRrt, m_identity,
|
||||
nsCOMPtr<nsISmtpService> smtpService = do_GetService(NS_SMTPSERVICE_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr<nsIRequest> aRequest;
|
||||
smtpService->SendMailMessage(m_fileSpec, m_dntRrt, m_identity,
|
||||
nsnull, this, nsnull, nsnull, nsnull,
|
||||
getter_AddRefs(aRequest));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMsgMdnGenerator::WriteString( const char *str )
|
||||
|
@ -878,20 +901,17 @@ nsresult nsMsgMdnGenerator::WriteString( const char *str )
|
|||
return m_outputStream->Write(str, len, &wLen);
|
||||
}
|
||||
|
||||
void nsMsgMdnGenerator::InitAndProcess()
|
||||
nsresult nsMsgMdnGenerator::InitAndProcess()
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::InitAndProcess");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::InitAndProcess");
|
||||
nsresult rv = m_folder->GetServer(getter_AddRefs(m_server));
|
||||
nsCOMPtr<nsIMsgAccountManager> accountManager =
|
||||
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsISupportsArray> identities;
|
||||
if (accountManager && m_server)
|
||||
{
|
||||
rv = accountManager->GetIdentitiesForServer(m_server,
|
||||
getter_AddRefs(identities));
|
||||
if (identities)
|
||||
rv = identities->QueryElementAt(0, NS_GET_IID(nsIMsgIdentity),
|
||||
(void **)getter_AddRefs(m_identity));
|
||||
rv = accountManager->GetFirstIdentityForServer(m_server, getter_AddRefs(m_identity));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (m_identity)
|
||||
{
|
||||
PRBool useCustomPrefs = PR_FALSE;
|
||||
|
@ -911,13 +931,13 @@ void nsMsgMdnGenerator::InitAndProcess()
|
|||
nsCOMPtr<nsIPref> prefs =
|
||||
do_GetService(NS_PREF_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch;
|
||||
|
||||
rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
return rv;
|
||||
|
||||
PRBool bVal = PR_FALSE;
|
||||
prefBranch->GetBoolPref("mail.mdn.report.enabled",
|
||||
|
@ -943,8 +963,9 @@ void nsMsgMdnGenerator::InitAndProcess()
|
|||
m_headers->ExtractHeader(HEADER_RETURN_RECEIPT_TO, PR_FALSE,
|
||||
getter_Copies(m_dntRrt));
|
||||
if (m_dntRrt && ProcessSendMode() && ValidateReturnPath())
|
||||
CreateMdnMsg();
|
||||
rv = CreateMdnMsg();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMdnGenerator::Process(EDisposeType type,
|
||||
|
@ -954,32 +975,35 @@ NS_IMETHODIMP nsMsgMdnGenerator::Process(EDisposeType type,
|
|||
nsIMimeHeaders *headers,
|
||||
PRBool autoAction)
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::Process");
|
||||
NS_ENSURE_ARG(folder);
|
||||
NS_ENSURE_ARG(headers);
|
||||
NS_ENSURE_ARG(aWindow);
|
||||
DEBUG_MDN("nsMsgMdnGenerator::Process");
|
||||
NS_ENSURE_ARG_POINTER(folder);
|
||||
NS_ENSURE_ARG_POINTER(headers);
|
||||
NS_ENSURE_ARG_POINTER(aWindow);
|
||||
NS_ENSURE_TRUE(key != nsMsgKey_None, NS_ERROR_INVALID_ARG);
|
||||
m_disposeType = type;
|
||||
m_autoAction = autoAction;
|
||||
m_window = aWindow;
|
||||
m_folder = folder;
|
||||
m_headers = headers;
|
||||
// Store the $MDNSent flag if the folder is an Imap Mail Folder
|
||||
StoreImapMDNSentFlag(folder, key);
|
||||
InitAndProcess();
|
||||
|
||||
nsresult rv = StoreMDNSentFlag(folder, key);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StoreMDNSentFlag failed");
|
||||
|
||||
rv = InitAndProcess();
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "InitAndProcess failed");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMdnGenerator::OnStartRunningUrl(nsIURI *url)
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::OnStartRunningUrl");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::OnStartRunningUrl");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMdnGenerator::OnStopRunningUrl(nsIURI *url,
|
||||
nsresult aExitCode)
|
||||
{
|
||||
DEBUG_MDN( "nsMsgMdnGenerator::OnStopRunningUrl");
|
||||
DEBUG_MDN("nsMsgMdnGenerator::OnStopRunningUrl");
|
||||
m_fileSpec->Delete(PR_FALSE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -68,23 +68,28 @@ public:
|
|||
virtual ~nsMsgMdnGenerator();
|
||||
|
||||
private:
|
||||
nsresult GetStringFromName(const PRUnichar *aName, PRUnichar **aResultString);
|
||||
// Sanity Check methods
|
||||
// Sanity Check methods
|
||||
PRBool ProcessSendMode(); // must called prior ValidateReturnPath
|
||||
PRBool ValidateReturnPath();
|
||||
PRBool NotInToOrCc();
|
||||
PRBool MailAddrMatch(const char *addr1, const char *addr2);
|
||||
|
||||
void StoreImapMDNSentFlag(nsIMsgFolder *folder, nsMsgKey key);
|
||||
nsresult StoreMDNSentFlag(nsIMsgFolder *folder, nsMsgKey key);
|
||||
|
||||
void CreateMdnMsg();
|
||||
nsresult CreateMdnMsg();
|
||||
nsresult CreateFirstPart();
|
||||
nsresult CreateSecondPart();
|
||||
nsresult CreateThirdPart();
|
||||
void DoSendMdn();
|
||||
nsresult SendMdnMsg();
|
||||
|
||||
// string bundle helper methods
|
||||
nsresult GetStringFromName(const PRUnichar *aName, PRUnichar **aResultString);
|
||||
nsresult FormatStringFromName(const PRUnichar *aName,
|
||||
const PRUnichar *aString,
|
||||
PRUnichar **aResultString);
|
||||
|
||||
// helper functions
|
||||
void InitAndProcess();
|
||||
// other helper methods
|
||||
nsresult InitAndProcess();
|
||||
nsresult OutputAllHeaders();
|
||||
nsresult WriteString(const char *str);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ interface nsIImapMessageSink : nsISupports {
|
|||
|
||||
void ParseAdoptedMsgLine(in string adoptedMsgLine, in nsMsgKey uidOfMsg);
|
||||
|
||||
void NormalEndMsgWriteStream(in nsMsgKey uidOfMessage, in boolean markMsgRead);
|
||||
void normalEndMsgWriteStream(in nsMsgKey uidOfMessage, in boolean markMsgRead, in nsIImapUrl imapUrl);
|
||||
|
||||
void AbortMsgWriteStream();
|
||||
|
||||
|
|
|
@ -201,19 +201,11 @@ nsImapIncomingServer::GetConstructedPrettyName(PRUnichar **retval)
|
|||
|
||||
nsCOMPtr<nsIMsgAccountManager> accountManager =
|
||||
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsISupportsArray> identities;
|
||||
rv = accountManager->GetIdentitiesForServer(this,
|
||||
getter_AddRefs(identities));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr<nsIMsgIdentity> identity;
|
||||
|
||||
rv = identities->QueryElementAt(0, NS_GET_IID(nsIMsgIdentity),
|
||||
(void **)getter_AddRefs(identity));
|
||||
rv = accountManager->GetFirstIdentityForServer(this, getter_AddRefs(identity));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsAutoString emailAddress;
|
||||
|
||||
|
@ -1445,7 +1437,7 @@ NS_IMETHODIMP nsImapIncomingServer::GetTrashFolderByRedirectorType(char **specia
|
|||
nsresult rv;
|
||||
|
||||
// see if it has a predefined trash folder name. The pref setting is like:
|
||||
// pref("imap.aol.treashFolder", "RECYCLE"); where the redirector type = 'aol'
|
||||
// pref("imap.aol.trashFolder", "RECYCLE"); where the redirector type = 'aol'
|
||||
nsCAutoString prefName;
|
||||
rv = CreatePrefNameWithRedirectorType(".trashFolder", prefName);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -1459,7 +1451,7 @@ NS_IMETHODIMP nsImapIncomingServer::GetTrashFolderByRedirectorType(char **specia
|
|||
return NS_ERROR_FAILURE;
|
||||
else
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapIncomingServer::AllowFolderConversion(PRBool *allowConversion)
|
||||
{
|
||||
|
@ -1483,7 +1475,7 @@ NS_IMETHODIMP nsImapIncomingServer::AllowFolderConversion(PRBool *allowConversio
|
|||
// In case this pref is not set we need to return NS_OK.
|
||||
rv = prefs->GetBoolPref(prefName.get(), allowConversion);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapIncomingServer::ConvertFolderName(const char *originalName, PRUnichar **convertedName)
|
||||
{
|
||||
|
@ -3636,3 +3628,5 @@ nsImapIncomingServer::OnUserOrHostNameChanged(const char *oldName, const char *n
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
NS_DECL_NSIIMAPINCOMINGSERVER
|
||||
NS_DECL_NSIIMAPSERVERSINK
|
||||
NS_DECL_NSIMSGLOGONREDIRECTIONREQUESTER
|
||||
NS_DECL_NSISUBSCRIBABLESERVER
|
||||
NS_DECL_NSISUBSCRIBABLESERVER
|
||||
NS_DECL_NSIURLLISTENER
|
||||
|
||||
NS_IMETHOD PerformBiff();
|
||||
|
@ -95,7 +95,7 @@ NS_IMETHOD GetCanUndoDeleteOnServer(PRBool *canUndoDeleteOnServer);
|
|||
NS_IMETHOD GetNumIdleConnections(PRInt32 *aNumIdleConnections);
|
||||
protected:
|
||||
nsresult GetFolder(const char* name, nsIMsgFolder** pFolder);
|
||||
nsresult ResetFoldersToUnverified(nsIFolder *parentFolder);
|
||||
nsresult ResetFoldersToUnverified(nsIFolder *parentFolder);
|
||||
nsresult GetUnverifiedSubFolders(nsIFolder *parentFolder, nsISupportsArray *aFoldersArray, PRInt32 *aNumUnverifiedFolders);
|
||||
nsresult GetUnverifiedFolders(nsISupportsArray *aFolderArray, PRInt32 *aNumUnverifiedFolders);
|
||||
|
||||
|
|
|
@ -97,6 +97,8 @@
|
|||
#include "nsIMAPNamespace.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsMsgMessageFlags.h"
|
||||
#include "nsIMimeHeaders.h"
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
#include <time.h>
|
||||
|
||||
static NS_DEFINE_CID(kMsgAccountManagerCID, NS_MSGACCOUNTMANAGER_CID);
|
||||
|
@ -113,7 +115,6 @@ static NS_DEFINE_CID(kMsgCopyServiceCID, NS_MSGCOPYSERVICE_CID);
|
|||
static NS_DEFINE_CID(kCopyMessageStreamListenerCID, NS_COPYMESSAGESTREAMLISTENER_CID);
|
||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
|
||||
|
||||
#define FOUR_K 4096
|
||||
#define MAILNEWS_CUSTOM_HEADERS "mailnews.customHeaders"
|
||||
|
||||
|
@ -620,8 +621,26 @@ nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow)
|
|||
PRBool selectFolder = PR_FALSE;
|
||||
|
||||
if (mFlags & MSG_FOLDER_FLAG_INBOX && !m_filterList)
|
||||
{
|
||||
rv = GetFilterList(msgWindow, getter_AddRefs(m_filterList));
|
||||
|
||||
if (m_filterList) {
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
rv = GetServer(getter_AddRefs(server));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get server");
|
||||
|
||||
PRBool canFileMessagesOnServer = PR_TRUE;
|
||||
if (server) {
|
||||
rv = server->GetCanFileMessagesOnServer(&canFileMessagesOnServer);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to determine if we could file messages on this server");
|
||||
}
|
||||
|
||||
// the mdn filter is for filing return receipts into the sent folder
|
||||
// some servers (like AOL mail servers)
|
||||
// can't file to the sent folder, so we don't add the filter for those servers
|
||||
if (canFileMessagesOnServer) {
|
||||
rv = server->ConfigureTemporaryReturnReceiptsFilter(m_filterList);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to add MDN filter");
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIImapService> imapService(do_GetService(kCImapService, &rv));
|
||||
|
@ -2827,40 +2846,45 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo
|
|||
!isRead)
|
||||
{
|
||||
|
||||
#if DOING_MDN // leave it to the user action
|
||||
struct message_header to;
|
||||
struct message_header cc;
|
||||
GetAggregateHeader (m_toList, &to);
|
||||
GetAggregateHeader (m_ccList, &cc);
|
||||
msgHdr->SetFlags(msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
|
||||
msgHdr->OrFlags(MSG_FLAG_MDN_REPORT_SENT, &newFlags);
|
||||
if (actionType == nsMsgFilterActionDelete)
|
||||
|
||||
nsCOMPtr<nsIMsgMdnGenerator> mdnGenerator;
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders;
|
||||
|
||||
mdnGenerator =
|
||||
do_CreateInstance(NS_MSGMDNGENERATOR_CONTRACTID, &rv);
|
||||
if (mdnGenerator)
|
||||
{
|
||||
MSG_ProcessMdnNeededState processMdnNeeded
|
||||
(MSG_ProcessMdnNeededState::eDeleted,
|
||||
m_pane, m_folder, msgHdr->GetMessageKey(),
|
||||
&state->m_return_path, &state->m_mdn_dnt,
|
||||
&to, &cc, &state->m_subject,
|
||||
&state->m_date, &state->m_mdn_original_recipient,
|
||||
&state->m_message_id, state->m_headers,
|
||||
(PRInt32) state->m_headers_fp, PR_TRUE);
|
||||
mimeHeaders = do_CreateInstance(NS_IMIMEHEADERS_CONTRACTID,
|
||||
&rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
nsXPIDLCString headers;
|
||||
PRInt32 headersSize;
|
||||
rv = m_msgParser->GetAllHeaders(getter_Copies(headers),
|
||||
&headersSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
mimeHeaders->Initialize(headers, headersSize);
|
||||
nsMsgKey msgKey;
|
||||
msgHdr->GetMessageKey(&msgKey);
|
||||
|
||||
if (actionType == nsMsgFilterAction::Delete)
|
||||
{
|
||||
mdnGenerator->Process(nsIMsgMdnGenerator::eDeleted,
|
||||
msgWindow, this, msgKey,
|
||||
mimeHeaders, PR_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
MSG_ProcessMdnNeededState processMdnNeeded
|
||||
(MSG_ProcessMdnNeededState::eProcessed,
|
||||
m_pane, m_folder, msgHdr->GetMessageKey(),
|
||||
&state->m_return_path, &state->m_mdn_dnt,
|
||||
&to, &cc, &state->m_subject,
|
||||
&state->m_date, &state->m_mdn_original_recipient,
|
||||
&state->m_message_id, state->m_headers,
|
||||
(PRInt32) state->m_headers_fp, PR_TRUE);
|
||||
mdnGenerator->Process(nsIMsgMdnGenerator::eProcessed,
|
||||
msgWindow, this, msgKey,
|
||||
mimeHeaders, PR_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
char *tmp = (char*) to.value;
|
||||
PR_FREEIF(tmp);
|
||||
tmp = (char*) cc.value;
|
||||
PR_FREEIF(tmp);
|
||||
#endif
|
||||
}
|
||||
nsresult err = MoveIncorporatedMessage(msgHdr, mDatabase, actionTargetFolderUri, filter, msgWindow);
|
||||
if (NS_SUCCEEDED(err))
|
||||
|
@ -3633,7 +3657,9 @@ nsImapMailFolder::ParseAdoptedMsgLine(const char *adoptedMessageLine, nsMsgKey u
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImapMailFolder::NormalEndMsgWriteStream(nsMsgKey uidOfMessage, PRBool markRead)
|
||||
nsImapMailFolder::NormalEndMsgWriteStream(nsMsgKey uidOfMessage,
|
||||
PRBool markRead,
|
||||
nsIImapUrl *imapUrl)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
PRBool commit = PR_FALSE;
|
||||
|
@ -3660,6 +3686,39 @@ nsImapMailFolder::NormalEndMsgWriteStream(nsMsgKey uidOfMessage, PRBool markRead
|
|||
msgHdr->GetIsRead(&isRead);
|
||||
if (!isRead)
|
||||
{
|
||||
PRUint32 msgFlags, newFlags;
|
||||
msgHdr->GetFlags(&msgFlags);
|
||||
if (msgFlags & MSG_FLAG_MDN_REPORT_NEEDED)
|
||||
{
|
||||
msgHdr->SetFlags(msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
|
||||
msgHdr->OrFlags(MSG_FLAG_MDN_REPORT_SENT, &newFlags);
|
||||
nsCOMPtr<nsIMsgMdnGenerator> mdnGenerator;
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders;
|
||||
nsCOMPtr<nsIMsgMailNewsUrl>
|
||||
msgUrl(do_QueryInterface(imapUrl, &res));
|
||||
if (NS_SUCCEEDED(res))
|
||||
{
|
||||
nsCOMPtr<nsIMsgWindow> msgWindow;
|
||||
|
||||
mdnGenerator =
|
||||
do_CreateInstance(NS_MSGMDNGENERATOR_CONTRACTID, &res);
|
||||
if (mdnGenerator)
|
||||
{
|
||||
res = msgUrl->GetMsgWindow(getter_AddRefs(msgWindow));
|
||||
if(NS_SUCCEEDED(res))
|
||||
{
|
||||
res = msgUrl->GetMimeHeaders(getter_AddRefs(mimeHeaders));
|
||||
if(NS_SUCCEEDED(res))
|
||||
{
|
||||
mdnGenerator->Process(nsIMsgMdnGenerator::eDisplayed,
|
||||
msgWindow, this, uidOfMessage,
|
||||
mimeHeaders, PR_FALSE);
|
||||
msgUrl->SetMimeHeaders(nsnull);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
msgHdr->MarkRead(PR_TRUE);
|
||||
commit = PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -3056,7 +3056,7 @@ void nsImapProtocol::NormalMessageEndDownload()
|
|||
m_runningUrl->GetImapAction(&imapAction);
|
||||
|
||||
if (m_imapMessageSink)
|
||||
m_imapMessageSink->NormalEndMsgWriteStream(m_downloadLineCache.CurrentUID(), imapAction == nsIImapUrl::nsImapMsgFetch);
|
||||
m_imapMessageSink->NormalEndMsgWriteStream(m_downloadLineCache.CurrentUID(), imapAction == nsIImapUrl::nsImapMsgFetch, m_runningUrl);
|
||||
|
||||
if (m_runningUrl && m_imapMailFolderSink)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,7 @@ REQUIRES = xpcom \
|
|||
msglocal \
|
||||
mimetype \
|
||||
unicharutil \
|
||||
mime \
|
||||
pref \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MODULE = impEudra
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
import \
|
||||
intl \
|
||||
necko \
|
||||
addrbook \
|
||||
mork \
|
||||
msgcompo \
|
||||
msgbase \
|
||||
editor \
|
||||
dom \
|
||||
uriloader \
|
||||
mailnews \
|
||||
msgdb \
|
||||
msgbaseutil \
|
||||
msglocal \
|
||||
mimetype \
|
||||
unicharutil \
|
||||
pref \
|
||||
$(NULL)
|
||||
LIBRARY_NAME = $(MODULE)
|
||||
META_COMPONENT = mail
|
||||
MODULE_NAME = nsEudoraImportModule
|
||||
|
||||
CPP_OBJS=\
|
||||
.\$(OBJDIR)\nsEudoraFactory.obj \
|
||||
.\$(OBJDIR)\nsEudoraStringBundle.obj \
|
||||
.\$(OBJDIR)\nsEudoraImport.obj \
|
||||
.\$(OBJDIR)\nsEudoraMailbox.obj \
|
||||
.\$(OBJDIR)\nsEudoraWin32.obj \
|
||||
.\$(OBJDIR)\nsEudoraSettings.obj \
|
||||
.\$(OBJDIR)\nsEudoraCompose.obj \
|
||||
.\$(OBJDIR)\nsEudoraAddress.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=\
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\msgbsutl.lib \
|
||||
$(DIST)\lib\unicharutil_s.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -46,6 +46,7 @@ REQUIRES = xpcom \
|
|||
msgbaseutil \
|
||||
msgcompose \
|
||||
msglocal \
|
||||
mime \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS=resources
|
||||
|
||||
MODULE = importOE
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
import \
|
||||
addrbook \
|
||||
mork \
|
||||
intl \
|
||||
msgbase \
|
||||
mailnews \
|
||||
necko \
|
||||
msgdb \
|
||||
msgbaseutil \
|
||||
msgcompo \
|
||||
msglocal \
|
||||
$(NULL)
|
||||
LIBRARY_NAME = $(MODULE)
|
||||
META_COMPONENT = mail
|
||||
MODULE_NAME = nsOEImport
|
||||
|
||||
CPP_OBJS=\
|
||||
.\$(OBJDIR)\nsOEImport.obj \
|
||||
.\$(OBJDIR)\nsOEFactory.obj \
|
||||
.\$(OBJDIR)\nsOEScanBoxes.obj \
|
||||
.\$(OBJDIR)\nsOEMailbox.obj \
|
||||
.\$(OBJDIR)\nsOEAddressIterator.obj \
|
||||
.\$(OBJDIR)\WabObject.obj \
|
||||
.\$(OBJDIR)\nsOERegUtil.obj \
|
||||
.\$(OBJDIR)\nsOE5File.obj \
|
||||
.\$(OBJDIR)\nsOESettings.obj \
|
||||
.\$(OBJDIR)\nsOEStringBundle.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=\
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\msgbsutl.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -55,6 +55,7 @@ REQUIRES = xpcom \
|
|||
msgdb \
|
||||
msglocal \
|
||||
mimetype \
|
||||
mime \
|
||||
unicharutil \
|
||||
pref \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MODULE = impOutlk
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
import \
|
||||
intl \
|
||||
necko \
|
||||
addrbook \
|
||||
mork \
|
||||
msgcompo \
|
||||
msgbase \
|
||||
editor \
|
||||
dom \
|
||||
uriloader \
|
||||
mailnews \
|
||||
msgbaseutil \
|
||||
msgdb \
|
||||
msglocal \
|
||||
mimetype \
|
||||
unicharutil \
|
||||
pref \
|
||||
$(NULL)
|
||||
LIBRARY_NAME = $(MODULE)
|
||||
META_COMPONENT = mail
|
||||
MODULE_NAME = nsOutlookImport
|
||||
|
||||
CPP_OBJS=\
|
||||
.\$(OBJDIR)\nsOutlookFactory.obj \
|
||||
.\$(OBJDIR)\nsOutlookRegUtil.obj \
|
||||
.\$(OBJDIR)\nsOutlookStringBundle.obj \
|
||||
.\$(OBJDIR)\nsOutlookImport.obj \
|
||||
.\$(OBJDIR)\nsOutlookSettings.obj \
|
||||
.\$(OBJDIR)\MapiApi.obj \
|
||||
.\$(OBJDIR)\nsOutlookMail.obj \
|
||||
.\$(OBJDIR)\MapiMessage.obj \
|
||||
.\$(OBJDIR)\MapiMimeTypes.obj \
|
||||
.\$(OBJDIR)\nsOutlookCompose.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=\
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\msgbsutl.lib \
|
||||
$(DIST)\lib\unicharutil_s.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -45,6 +45,7 @@ REQUIRES = xpcom \
|
|||
rdf \
|
||||
msgdb \
|
||||
unicharutil \
|
||||
mime \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(USE_SHORT_LIBNAME),1)
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE = import
|
||||
LIBRARY_NAME = $(MODULE)
|
||||
META_COMPONENT = mail
|
||||
MODULE_NAME = nsImportServiceModule
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
mailnews \
|
||||
addrbook \
|
||||
uconv \
|
||||
mork \
|
||||
msgbase \
|
||||
msgbaseutil \
|
||||
intl \
|
||||
necko \
|
||||
rdf \
|
||||
msgdb \
|
||||
unicharutil \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS=\
|
||||
.\$(OBJDIR)\nsImportFactory.obj \
|
||||
.\$(OBJDIR)\nsImportService.obj \
|
||||
.\$(OBJDIR)\nsImportMail.obj \
|
||||
.\$(OBJDIR)\nsImportMailboxDescriptor.obj \
|
||||
.\$(OBJDIR)\nsImportABDescriptor.obj \
|
||||
.\$(OBJDIR)\nsImportAddressBooks.obj \
|
||||
.\$(OBJDIR)\nsImportStringBundle.obj \
|
||||
.\$(OBJDIR)\ImportTranslate.obj \
|
||||
.\$(OBJDIR)\nsImportTranslator.obj \
|
||||
.\$(OBJDIR)\ImportCharSet.obj \
|
||||
.\$(OBJDIR)\ImportOutFile.obj \
|
||||
.\$(OBJDIR)\nsImportScanFile.obj \
|
||||
.\$(OBJDIR)\nsImportEncodeScan.obj \
|
||||
.\$(OBJDIR)\nsImportMimeEncode.obj \
|
||||
.\$(OBJDIR)\nsImportFieldMap.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=\
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\unicharutil_s.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -52,7 +52,7 @@
|
|||
#include "nsMsgDBCID.h"
|
||||
#include "nsIMsgMailNewsUrl.h"
|
||||
#include "nsICopyMsgStreamListener.h"
|
||||
//#include "allxpstr.h"
|
||||
#include "nsMsgMessageFlags.h"
|
||||
#include "prtime.h"
|
||||
#include "prlog.h"
|
||||
#include "prerror.h"
|
||||
|
@ -69,12 +69,14 @@ PRLogModuleInfo *MAILBOX;
|
|||
#include "nsXPIDLString.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIMsgWindow.h"
|
||||
#include "nsIMimeHeaders.h"
|
||||
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
|
||||
static NS_DEFINE_CID(kIStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID);
|
||||
static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID);
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
|
||||
|
||||
/* the output_buffer_size must be larger than the largest possible line
|
||||
* 2000 seems good for news
|
||||
*
|
||||
|
@ -385,6 +387,7 @@ PRInt32 nsMailboxProtocol::DoneReadingMessage()
|
|||
{
|
||||
// now mark the message as read
|
||||
nsCOMPtr<nsIMsgDBHdr> msgHdr;
|
||||
nsMsgKey msgKey;
|
||||
if (m_runningUrl)
|
||||
rv = m_runningUrl->GetMessageHeader(getter_AddRefs(msgHdr));
|
||||
NS_ASSERTION(msgHdr, "no msg hdr!");
|
||||
|
@ -392,7 +395,54 @@ PRInt32 nsMailboxProtocol::DoneReadingMessage()
|
|||
PRBool isRead;
|
||||
msgHdr->GetIsRead(&isRead);
|
||||
if (NS_SUCCEEDED(rv) && !isRead)
|
||||
{
|
||||
PRUint32 msgFlags, newFlags;
|
||||
msgHdr->GetFlags(&msgFlags);
|
||||
if (msgFlags & MSG_FLAG_MDN_REPORT_NEEDED)
|
||||
{
|
||||
nsCOMPtr<nsIMsgMdnGenerator> mdnGenerator;
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders;
|
||||
|
||||
mdnGenerator =
|
||||
do_CreateInstance(NS_MSGMDNGENERATOR_CONTRACTID, &rv);
|
||||
|
||||
// To ensure code works w/o MDN enabled
|
||||
if (NS_SUCCEEDED(rv) && mdnGenerator)
|
||||
{
|
||||
mimeHeaders =
|
||||
do_CreateInstance(NS_IMIMEHEADERS_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && mimeHeaders)
|
||||
{
|
||||
nsCOMPtr<nsIMsgFolder> msgFolder;
|
||||
msgHdr->GetFolder(getter_AddRefs(msgFolder));
|
||||
nsCOMPtr<nsIMsgMailNewsUrl> msgUrl =
|
||||
do_QueryInterface(m_runningUrl);
|
||||
if (msgUrl)
|
||||
{
|
||||
nsCOMPtr<nsIMsgWindow> msgWindow;
|
||||
msgUrl->GetMsgWindow(getter_AddRefs(msgWindow));
|
||||
msgHdr->GetMessageKey(&msgKey);
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders;
|
||||
msgUrl->GetMimeHeaders(getter_AddRefs(mimeHeaders));
|
||||
mdnGenerator->Process(nsIMsgMdnGenerator::eDisplayed,
|
||||
msgWindow, msgFolder, msgKey,
|
||||
mimeHeaders, PR_FALSE);
|
||||
msgUrl->SetMimeHeaders(nsnull);
|
||||
// no longer needed
|
||||
}
|
||||
}
|
||||
}
|
||||
// unsetting MDN_REPORT_NEEDED flag and mark the message as
|
||||
// MDN_REPORT_SENT
|
||||
// There are cases that: a) user wishes not to send MDN, b)
|
||||
// mdn module is not installed, c) the message can be marked
|
||||
// as unread and force it back to the original mdn
|
||||
// needed state.
|
||||
msgHdr->SetFlags(msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
|
||||
msgHdr->OrFlags(MSG_FLAG_MDN_REPORT_SENT, &newFlags);
|
||||
}
|
||||
msgHdr->MarkRead(PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -69,6 +69,10 @@
|
|||
#include "nsMsgUtils.h"
|
||||
#include "prprf.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsIMimeHeaders.h"
|
||||
|
||||
#include "nsIMsgMdnGenerator.h"
|
||||
#include "nsMsgSearchCore.h"
|
||||
|
||||
static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID);
|
||||
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||
|
@ -80,8 +84,7 @@ NS_IMPL_ISUPPORTS_INHERITED2(nsMsgMailboxParser, nsParseMailMessageState, nsIStr
|
|||
|
||||
// Whenever data arrives from the connection, core netlib notifices the protocol by calling
|
||||
// OnDataAvailable. We then read and process the incoming data from the input stream.
|
||||
NS_IMETHODIMP nsMsgMailboxParser::OnDataAvailable(nsIRequest *request, nsISupports *ctxt, nsIInputStream *aIStream, PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
NS_IMETHODIMP nsMsgMailboxParser::OnDataAvailable(nsIRequest *request, nsISupports *ctxt, nsIInputStream *aIStream, PRUint32 sourceOffset, PRUint32 aLength)
|
||||
{
|
||||
// right now, this really just means turn around and process the url
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -1442,56 +1445,10 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsIMsgFolder *downloadFolder, n
|
|||
if (NS_SUCCEEDED(rv))
|
||||
rv = server->GetFilterList(aMsgWindow, getter_AddRefs(m_filterList));
|
||||
m_logFile = nsnull;
|
||||
#ifdef DOING_MDN
|
||||
|
||||
if (m_filterList)
|
||||
{
|
||||
const char *folderName = nsnull;
|
||||
PRInt32 int_pref = 0;
|
||||
PREF_GetIntPref("mail.incorporate.return_receipt", &int_pref);
|
||||
if (int_pref == 1)
|
||||
{
|
||||
nsIMsgFolder *folderInfo = nsnull;
|
||||
int status = 0;
|
||||
char *defaultFolderName =
|
||||
msg_MagicFolderName(master->GetPrefs(),
|
||||
MSG_FOLDER_FLAG_SENTMAIL, &status);
|
||||
if (defaultFolderName)
|
||||
{
|
||||
folderInfo = master->FindMailFolder(defaultFolderName, PR_FALSE);
|
||||
if (folderInfo && folderInfo->GetMailFolderInfo())
|
||||
folderName = folderInfo->GetMailFolderInfo()->GetPathname();
|
||||
XP_FREE(defaultFolderName);
|
||||
}
|
||||
}
|
||||
if (folderName)
|
||||
{
|
||||
MSG_Filter *newFilter = new MSG_Filter(filterInboxRule, "receipt");
|
||||
if (newFilter)
|
||||
{
|
||||
MSG_Rule *rule = nsnull;
|
||||
MSG_SearchValue value;
|
||||
newFilter->SetDescription("incorporate mdn report");
|
||||
newFilter->SetEnabled(PR_TRUE);
|
||||
newFilter->GetRule(&rule);
|
||||
newFilter->SetFilterList(m_filterList);
|
||||
value.attribute = attribOtherHeader;
|
||||
value.u.string = "multipart/report";
|
||||
rule->AddTerm(attribOtherHeader, opContains,
|
||||
&value, PR_TRUE, "Content-Type");
|
||||
value.u.string = "disposition-notification";
|
||||
rule->AddTerm(attribOtherHeader, opContains,
|
||||
&value, PR_TRUE, "Content-Type");
|
||||
#if 0
|
||||
value.u.string = "delivery-status";
|
||||
rule->AddTerm(attribOtherHeader, opContains,
|
||||
&value, PR_FALSE, "Content-Type");
|
||||
#endif
|
||||
rule->SetAction(nsMsgFilterActionMoveToFolder, (void*)folderName);
|
||||
m_filterList->InsertFilterAt(0, newFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // DOING_MDN
|
||||
rv = server->ConfigureTemporaryReturnReceiptsFilter(m_filterList);
|
||||
|
||||
m_usingTempDB = PR_FALSE;
|
||||
m_tmpdbName = nsnull;
|
||||
m_disableFilters = PR_FALSE;
|
||||
|
@ -1713,49 +1670,67 @@ NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWi
|
|||
if (msgFlags & MSG_FLAG_MDN_REPORT_NEEDED &&
|
||||
!isRead)
|
||||
{
|
||||
struct message_header to;
|
||||
struct message_header cc;
|
||||
GetAggregateHeader (m_toList, &to);
|
||||
GetAggregateHeader (m_ccList, &cc);
|
||||
msgHdr->SetFlags(msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
|
||||
msgHdr->OrFlags(MSG_FLAG_MDN_REPORT_SENT, &newFlags);
|
||||
nsCOMPtr<nsIMsgMdnGenerator> mdnGenerator;
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders;
|
||||
|
||||
#if DOING_MDN // leave it to the user action
|
||||
if (actionType == nsMsgFilterActionDelete)
|
||||
{
|
||||
MSG_ProcessMdnNeededState processMdnNeeded
|
||||
(MSG_ProcessMdnNeededState::eDeleted,
|
||||
m_pane, m_folder, msgHdr->GetMessageKey(),
|
||||
&state->m_return_path, &state->m_mdn_dnt,
|
||||
&to, &cc, &state->m_subject,
|
||||
&state->m_date, &state->m_mdn_original_recipient,
|
||||
&state->m_message_id, state->m_headers,
|
||||
(PRInt32) state->m_headers_fp, PR_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
MSG_ProcessMdnNeededState processMdnNeeded
|
||||
(MSG_ProcessMdnNeededState::eProcessed,
|
||||
m_pane, m_folder, msgHdr->GetMessageKey(),
|
||||
&state->m_return_path, &state->m_mdn_dnt,
|
||||
&to, &cc, &state->m_subject,
|
||||
&state->m_date, &state->m_mdn_original_recipient,
|
||||
&state->m_message_id, state->m_headers,
|
||||
(PRInt32) state->m_headers_fp, PR_TRUE);
|
||||
}
|
||||
#endif
|
||||
char *tmp = (char*) to.value;
|
||||
PR_FREEIF(tmp);
|
||||
tmp = (char*) cc.value;
|
||||
PR_FREEIF(tmp);
|
||||
}
|
||||
nsresult err = MoveIncorporatedMessage(msgHdr, m_mailDB, (const char *) actionTargetFolderUri, filter, msgWindow);
|
||||
if (NS_SUCCEEDED(err))
|
||||
m_msgMovedByFilter = PR_TRUE;
|
||||
mdnGenerator =
|
||||
do_CreateInstance(NS_MSGMDNGENERATOR_CONTRACTID, &rv);
|
||||
|
||||
// To ensure code works w/o MDN enabled
|
||||
if (NS_SUCCEEDED(rv) && mdnGenerator) {
|
||||
mimeHeaders = do_CreateInstance(NS_IMIMEHEADERS_CONTRACTID, &rv);
|
||||
|
||||
}
|
||||
if (NS_SUCCEEDED(rv) && mimeHeaders) {
|
||||
nsXPIDLCString allHeaders;
|
||||
PRInt32 allHeadersSize = 0;
|
||||
|
||||
rv = GetAllHeaders(getter_Copies(allHeaders),
|
||||
&allHeadersSize);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = mimeHeaders->Initialize(allHeaders, allHeadersSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
nsCOMPtr <nsIMsgFolder> rootMsgFolder =
|
||||
do_QueryInterface(m_rootFolder, &rv);
|
||||
if (NS_SUCCEEDED(rv) && rootMsgFolder)
|
||||
{
|
||||
nsMsgKey msgKey;
|
||||
msgHdr->GetMessageKey(&msgKey);
|
||||
|
||||
if (actionType == nsMsgFilterAction::Delete)
|
||||
{
|
||||
mdnGenerator->Process(nsIMsgMdnGenerator::eDeleted,
|
||||
msgWindow, rootMsgFolder,
|
||||
msgKey,
|
||||
mimeHeaders, PR_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
mdnGenerator->Process(nsIMsgMdnGenerator::eProcessed,
|
||||
msgWindow, rootMsgFolder,
|
||||
msgKey,
|
||||
mimeHeaders, PR_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// unsetting MDN_REPORT_NEEDED flag and mark the message as
|
||||
// MDN_REPORT_SENT
|
||||
// There are cases that: a) user wishes not to send MDN, b)
|
||||
// mdn module is not installed, c) the message can be marked
|
||||
// as unread and force it back to the original mdn
|
||||
// needed state.
|
||||
msgHdr->SetFlags(msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);
|
||||
msgHdr->OrFlags(MSG_FLAG_MDN_REPORT_SENT, &newFlags);
|
||||
}
|
||||
nsresult err = MoveIncorporatedMessage(msgHdr, m_mailDB, (const char *) actionTargetFolderUri, filter, msgWindow);
|
||||
if (NS_SUCCEEDED(err))
|
||||
m_msgMovedByFilter = PR_TRUE;
|
||||
}
|
||||
*applyMore = PR_FALSE;
|
||||
break;
|
||||
break;
|
||||
case nsMsgFilterAction::MarkRead:
|
||||
MarkFilteredMessageRead(msgHdr);
|
||||
break;
|
||||
|
|
|
@ -68,7 +68,7 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
nsnull, nsMimeObjectClassAccessConstructor },
|
||||
|
||||
{ "Mime Converter", NS_MIME_CONVERTER_CID,
|
||||
nsnull, nsMimeConverterConstructor },
|
||||
NS_MIME_CONVERTER_CONTRACTID, nsMimeConverterConstructor },
|
||||
|
||||
{ "Msg Header Parser", NS_MSGHEADERPARSER_CID,
|
||||
NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, nsMsgHeaderParserConstructor },
|
||||
|
@ -86,7 +86,7 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
nsStreamConverterConstructor, 0, 0, streamConverterDestructor },
|
||||
|
||||
{ "Mime Headers", NS_IMIMEHEADERS_CID,
|
||||
nsnull, nsMimeHeadersConstructor }
|
||||
NS_IMIMEHEADERS_CONTRACTID, nsMimeHeadersConstructor }
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE(mime_services, gComponents)
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsMessageMimeCID_h__
|
||||
#define nsMessageMimeCID_h__
|
||||
|
||||
#define NS_MAILNEWS_MIME_STREAM_CONVERTER_CONTRACTID \
|
||||
NS_ISTREAMCONVERTER_KEY "?from=message/rfc822&to=application/vnd.mozilla.xul+xml"
|
||||
|
||||
#define NS_MAILNEWS_MIME_STREAM_CONVERTER_CONTRACTID1 \
|
||||
NS_ISTREAMCONVERTER_KEY "?from=message/rfc822&to=text/html"
|
||||
|
||||
#define NS_MAILNEWS_MIME_STREAM_CONVERTER_CONTRACTID2 \
|
||||
NS_ISTREAMCONVERTER_KEY "?from=message/rfc822&to=*/*"
|
||||
|
||||
#define NS_MAILNEWS_MIME_STREAM_CONVERTER_CID \
|
||||
{ /* FAF4F9A6-60AD-11d3-989A-001083010E9B */ \
|
||||
0xfaf4f9a6, 0x60ad, 0x11d3, { 0x98, 0x9a, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
|
||||
|
||||
// {866A1E11-D0B9-11d2-B373-525400E2D63A}
|
||||
#define NS_MIME_CONVERTER_CID \
|
||||
{ 0x866a1e11, 0xd0b9, 0x11d2, \
|
||||
{ 0xb3, 0x73, 0x52, 0x54, 0x0, 0xe2, 0xd6, 0x3a } }
|
||||
|
||||
// {403B0540-B7C3-11d2-B35E-525400E2D63A}
|
||||
#define NS_MIME_OBJECT_CLASS_ACCESS_CID \
|
||||
{ 0x403b0540, 0xb7c3, 0x11d2, \
|
||||
{ 0xb3, 0x5e, 0x52, 0x54, 0x0, 0xe2, 0xd6, 0x3a } }
|
||||
|
||||
// {932C53A5-F398-11d2-82B7-444553540002}
|
||||
#define NS_MSGHEADERPARSER_CID \
|
||||
{ 0x932c53a5, 0xf398, 0x11d2, \
|
||||
{ 0x82, 0xb7, 0x44, 0x45, 0x53, 0x54, 0x0, 0x2 } }
|
||||
|
||||
#endif // nsMessageMimeCID_h__
|
|
@ -62,6 +62,9 @@
|
|||
#include "nsMsgMimeCID.h"
|
||||
#include "prlog.h"
|
||||
#include "prprf.h"
|
||||
#include "nsIMimeHeaders.h"
|
||||
#include "nsIMsgWindow.h"
|
||||
#include "nsIMsgMailNewsUrl.h"
|
||||
|
||||
static PRLogModuleInfo * gMimeEmitterLogModule = nsnull;
|
||||
|
||||
|
@ -620,6 +623,22 @@ nsMimeBaseEmitter::AddHeaderField(const char *field, const char *value)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMimeBaseEmitter::AddAllHeaders(const char *allheaders,
|
||||
const PRInt32 allheadersize)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIMsgMailNewsUrl> msgurl (do_QueryInterface(mURL));
|
||||
if (msgurl)
|
||||
{
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders = do_CreateInstance(NS_IMIMEHEADERS_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
mimeHeaders->Initialize(allheaders, allheadersize);
|
||||
msgurl->SetMimeHeaders(mimeHeaders);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// The following code is responsible for formatting headers in a manner that is
|
||||
// identical to the normal XUL output.
|
||||
|
|
|
@ -74,6 +74,7 @@ interface nsIMimeEmitter : nsISupports{
|
|||
void StartHeader(in PRBool rootMailHeader, in PRBool headerOnly,
|
||||
[const] in string msgID, [const] in string outCharset);
|
||||
void AddHeaderField([const] in string field, [const] in string value);
|
||||
void addAllHeaders(in string allheaders, in long allheadersize);
|
||||
void WriteHTMLHeaders(); // book case this with a EndHeader call.
|
||||
void EndHeader();
|
||||
void UpdateCharacterSet([const] in string aCharset);
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include "nsrootidl.idl"
|
||||
|
||||
%{C++
|
||||
#define NS_IMIMEHEADERS_CONTRACTID \
|
||||
"@mozilla.org/messenger/mimeheaders;1"
|
||||
// {9C4DA772-07EB-11d3-8EE5-00A024669799}
|
||||
#define NS_IMIMEHEADERS_CID \
|
||||
{ 0x13e16677, 0x6648, 0x11d3, \
|
||||
|
@ -50,9 +52,9 @@
|
|||
*/
|
||||
[scriptable, uuid(13E16676-6648-11d3-A72F-0060B0EB39B5)]
|
||||
interface nsIMimeHeaders : nsISupports {
|
||||
|
||||
void initialize([const] in string allHeaders, in long allHeadersSize);
|
||||
string extractHeader ([const] in string headerName, in boolean getAllOfThem);
|
||||
void initialize([const] in string allHeaders, in long allHeadersSize);
|
||||
string extractHeader ([const] in string headerName, in boolean getAllOfThem);
|
||||
readonly attribute string allHeaders;
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
|
|
@ -1350,7 +1350,11 @@ mime_parse_stream_complete (nsMIMESession *stream)
|
|||
int receiptType = 0;
|
||||
fields->SetReturnReceipt(PR_TRUE);
|
||||
sscanf(parm, "%d", &receiptType);
|
||||
fields->SetReturnReceipt((PRInt32) receiptType);
|
||||
// slight change compared to 4.x; we used to use receipt= to tell
|
||||
// whether the draft/template has request for either MDN or DNS or both
|
||||
// return receipt; since the DNS is out of the picture we now use the
|
||||
// header type - 1 to tell whether user has requested the return receipt
|
||||
fields->SetReceiptHeaderType(((PRInt32)receiptType) - 1);
|
||||
}
|
||||
PR_FREEIF(parm);
|
||||
parm = MimeHeaders_get_parameter(draftInfo, "uuencode", NULL, NULL);
|
||||
|
|
|
@ -802,6 +802,7 @@ MimeHeaders_write_all_headers (MimeHeaders *hdrs, MimeDisplayOptions *opt, PRBoo
|
|||
if (!wrote_any_p)
|
||||
wrote_any_p = (status > 0);
|
||||
}
|
||||
mimeEmitterAddAllHeaders(opt, hdrs->all_headers, hdrs->all_headers_fp);
|
||||
PR_FREEIF(charset);
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -1733,6 +1733,26 @@ mimeEmitterAddHeaderField(MimeDisplayOptions *opt, const char *field, const char
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
extern "C" nsresult
|
||||
mimeEmitterAddAllHeaders(MimeDisplayOptions *opt, const char *allheaders, const PRInt32 allheadersize)
|
||||
{
|
||||
// Check for draft processing...
|
||||
if (NoEmitterProcessing(opt->format_out))
|
||||
return NS_OK;
|
||||
|
||||
mime_stream_data *msd = GetMSD(opt);
|
||||
if (!msd)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (msd->output_emitter)
|
||||
{
|
||||
nsIMimeEmitter *emitter = (nsIMimeEmitter *)msd->output_emitter;
|
||||
return emitter->AddAllHeaders(allheaders, allheadersize);
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
extern "C" nsresult
|
||||
mimeEmitterStartAttachment(MimeDisplayOptions *opt, const char *name, const char *contentType, const char *url,
|
||||
PRBool aNotDownloaded)
|
||||
|
|
|
@ -176,6 +176,7 @@ extern "C" nsIMimeEmitter *GetMimeEmitter(MimeDisplayOptions *opt);
|
|||
extern "C" nsresult mimeSetNewURL(nsMIMESession *stream, char *url);
|
||||
extern "C" nsresult mimeEmitterAddAttachmentField(MimeDisplayOptions *opt, const char *field, const char *value);
|
||||
extern "C" nsresult mimeEmitterAddHeaderField(MimeDisplayOptions *opt, const char *field, const char *value);
|
||||
extern "C" nsresult mimeEmitterAddAllHeaders(MimeDisplayOptions *opt, const char *allheaders, const PRInt32 allheadersize);
|
||||
extern "C" nsresult mimeEmitterStartAttachment(MimeDisplayOptions *opt, const char *name, const char *contentType, const char *url,
|
||||
PRBool aNotDownloaded);
|
||||
extern "C" nsresult mimeEmitterEndAttachment(MimeDisplayOptions *opt);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "msgCore.h" // precompiled header...
|
||||
#include "nsMimeHeaders.h"
|
||||
#include "prmem.h"
|
||||
|
||||
nsMimeHeaders::nsMimeHeaders() :
|
||||
mHeaders(nsnull)
|
||||
|
@ -76,3 +77,22 @@ nsresult nsMimeHeaders::ExtractHeader(const char *headerName, PRBool getAllOfThe
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMimeHeaders::GetAllHeaders(char **_retval)
|
||||
{
|
||||
if (!mHeaders)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
if (!mHeaders->all_headers)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
char *allHeaders = (char *) PR_MALLOC(mHeaders->all_headers_fp + 1);
|
||||
NS_ASSERTION (allHeaders, "nsMimeHeaders - out of memory");
|
||||
if (!allHeaders)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
memcpy(allHeaders, mHeaders->all_headers, mHeaders->all_headers_fp);
|
||||
*(allHeaders + mHeaders->all_headers_fp) = 0;
|
||||
*_retval = allHeaders;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -992,13 +992,8 @@ nsStreamConverter::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresul
|
|||
|
||||
if (workHeaders)
|
||||
{
|
||||
static NS_DEFINE_CID(kCIMimeHeadersCID, NS_IMIMEHEADERS_CID);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders;
|
||||
|
||||
rv = nsComponentManager::CreateInstance(kCIMimeHeadersCID,
|
||||
nsnull, NS_GET_IID(nsIMimeHeaders),
|
||||
(void **) getter_AddRefs(mimeHeaders));
|
||||
nsCOMPtr<nsIMimeHeaders> mimeHeaders = do_CreateInstance(NS_IMIMEHEADERS_CONTRACTID, &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
|
|
|
@ -340,6 +340,9 @@ viewer:Essential Files:LDAPClient.shlb
|
|||
viewer:Components:msgsmime.shlb
|
||||
viewer:Components:msgsmime.xpt
|
||||
viewer:Components:smime-service.js
|
||||
viewer:Components:msgmdn.shlb
|
||||
viewer:Components:msgmdn.xpt
|
||||
viewer:Components:mdn-service.js
|
||||
|
||||
[chatzilla]
|
||||
viewer:Components:chatzilla-service.js
|
||||
|
|
|
@ -254,7 +254,8 @@ bin/components/absync.xpt
|
|||
bin/chrome/messenger.jar
|
||||
bin/components/msgsmime.xpt
|
||||
bin/components/smime-service.js
|
||||
|
||||
bin/components/msgmdn.xpt
|
||||
bin/components/mdn-service.js
|
||||
|
||||
[chatzilla]
|
||||
bin/components/chatzilla-service.js
|
||||
|
|
|
@ -271,6 +271,8 @@ bin\components\nsLDAPPrefsService.js
|
|||
bin\components\mozldap.xpt
|
||||
bin\components\msgsmime.xpt
|
||||
bin\components\smime-service.js
|
||||
bin\components\msgmdn.xpt
|
||||
bin\components\mdn-service.js
|
||||
bin\components\mapihook.xpt
|
||||
bin\chrome\messenger.jar
|
||||
bin\chrome\messenger\*
|
||||
|
|
|
@ -353,7 +353,9 @@ bin/chrome/messenger.jar
|
|||
bin/components/libmsgsmime.so
|
||||
bin/components/msgsmime.xpt
|
||||
bin/components/smime-service.js
|
||||
|
||||
bin/components/libmsgmdn.so
|
||||
bin/components/msgmdn.xpt
|
||||
bin/components/mdn-service.js
|
||||
|
||||
[chatzilla]
|
||||
bin/components/chatzilla-service.js
|
||||
|
|
|
@ -377,6 +377,9 @@ bin\MapiProxy.dll
|
|||
bin\mozMapi32.dll
|
||||
bin\components\msgMapi.dll
|
||||
bin\components\mapihook.xpt
|
||||
bin\components\msgmdn.dll
|
||||
bin\components\msgmdn.xpt
|
||||
bin\components\mdn-service.js
|
||||
|
||||
[chatzilla]
|
||||
bin\components\chatzilla-service.js
|
||||
|
|
Загрузка…
Ссылка в новой задаче