Коммит
9330480476
|
@ -1 +1 @@
|
|||
85b424089b9f8a2c7c0c95ee00e7802c5a495c45
|
||||
0bb2a0ee37c1af1c76d758c1eee1d99b18924704
|
54
configure.in
54
configure.in
|
@ -129,7 +129,6 @@ dnl ========================================================
|
|||
GLIB_VERSION=1.2.0
|
||||
LIBIDL_VERSION=0.6.3
|
||||
PERL_VERSION=5.006
|
||||
CAIRO_VERSION=1.6.0
|
||||
PANGO_VERSION=1.14.0
|
||||
GTK2_VERSION=2.10.0
|
||||
MAKE_VERSION=3.78
|
||||
|
@ -7168,7 +7167,6 @@ AC_SUBST(HOST_LIBIDL_LIBS)
|
|||
dnl ========================================================
|
||||
dnl Check for cairo
|
||||
dnl ========================================================
|
||||
MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
|
||||
|
||||
MOZ_TREE_CAIRO=1
|
||||
MOZ_ARG_ENABLE_BOOL(system-cairo,
|
||||
|
@ -7182,62 +7180,15 @@ AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
|
|||
if test "$MOZ_TREE_CAIRO"; then
|
||||
AC_DEFINE(MOZ_TREE_CAIRO)
|
||||
|
||||
# For now we assume that we will have a uint64_t available through
|
||||
# one of the above headers or mozstdint.h.
|
||||
AC_DEFINE(HAVE_UINT64_T)
|
||||
|
||||
# Define macros for cairo-features.h
|
||||
if test "$MOZ_X11"; then
|
||||
XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
|
||||
XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
|
||||
PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
|
||||
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
|
||||
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
|
||||
fi
|
||||
if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
|
||||
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
|
||||
QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
|
||||
QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
|
||||
fi
|
||||
if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
|
||||
WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
|
||||
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
|
||||
fi
|
||||
if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
|
||||
OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
|
||||
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
|
||||
CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
|
||||
CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
|
||||
fi
|
||||
if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
|
||||
PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
|
||||
BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
|
||||
fi
|
||||
AC_SUBST(CAIRO_FT_CFLAGS)
|
||||
|
||||
if test "$MOZ_DEBUG"; then
|
||||
SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
|
||||
else
|
||||
SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
|
||||
fi
|
||||
|
||||
PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
|
||||
|
||||
AC_SUBST(PS_SURFACE_FEATURE)
|
||||
AC_SUBST(PDF_SURFACE_FEATURE)
|
||||
AC_SUBST(SVG_SURFACE_FEATURE)
|
||||
AC_SUBST(XLIB_SURFACE_FEATURE)
|
||||
AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
|
||||
AC_SUBST(QUARTZ_SURFACE_FEATURE)
|
||||
AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
|
||||
AC_SUBST(XCB_SURFACE_FEATURE)
|
||||
AC_SUBST(WIN32_SURFACE_FEATURE)
|
||||
AC_SUBST(OS2_SURFACE_FEATURE)
|
||||
AC_SUBST(BEOS_SURFACE_FEATURE)
|
||||
AC_SUBST(DIRECTFB_SURFACE_FEATURE)
|
||||
AC_SUBST(QUARTZ_FONT_FEATURE)
|
||||
AC_SUBST(PNG_FUNCTIONS_FEATURE)
|
||||
|
||||
if test "$_WIN32_MSVC"; then
|
||||
MOZ_CAIRO_LIBS='$(DEPTH)/mozilla/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/mozilla/gfx/cairo/libpixman/src/mozlibpixman.lib'
|
||||
else
|
||||
|
@ -7248,18 +7199,13 @@ if test "$MOZ_TREE_CAIRO"; then
|
|||
fi
|
||||
fi
|
||||
else
|
||||
PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
|
||||
MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
|
||||
MOZ_CAIRO_LIBS=$CAIRO_LIBS
|
||||
if test "$MOZ_X11"; then
|
||||
PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
|
||||
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
|
||||
MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_TREE_CAIRO)
|
||||
AC_SUBST(MOZ_CAIRO_CFLAGS)
|
||||
AC_SUBST(MOZ_CAIRO_LIBS)
|
||||
|
||||
dnl qcms
|
||||
|
|
|
@ -579,7 +579,7 @@ function updateButtons(tree, account) {
|
|||
// either way, we don't want the user to be able to delete it or duplicate it
|
||||
|
||||
canSetDefault = false;
|
||||
canDelete = (serverId == "http://home.netscape.com/NC-rdf#PageTitleFakeAccount");
|
||||
canDelete = false;
|
||||
canDuplicate = false;
|
||||
}
|
||||
|
||||
|
@ -696,7 +696,7 @@ function loadPage(pageId)
|
|||
try
|
||||
{
|
||||
// we could compare against "main","server","copies","offline","addressing",
|
||||
// "smtp","advanced", and "fakeaccount" first to save the work, but don't
|
||||
// "smtp" and "advanced" first to save the work, but don't,
|
||||
// as some of these might be turned into extensions (for thunderbird)
|
||||
var am = Components.classes["@mozilla.org/messenger/account-manager;1"]
|
||||
.getService(Components.interfaces.nsIMsgAccountManager);
|
||||
|
|
|
@ -54,7 +54,6 @@ var pageTagPairs = {
|
|||
"chrome://messenger/content/am-smime.xul": "mail_security_settings",
|
||||
"chrome://messenger/content/am-serverwithnoidentities.xul": "mail_local_folders_settings",
|
||||
"chrome://messenger/content/am-mdn.xul": "mail-account-receipts",
|
||||
"chrome://messenger/content/am-fakeaccount.xul": "fake_account"
|
||||
}
|
||||
|
||||
function doHelpButton()
|
||||
|
|
|
@ -54,8 +54,6 @@
|
|||
#include "nsICategoryManager.h"
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch2.h"
|
||||
|
||||
// turn this on to see useful output
|
||||
#undef DEBUG_amds
|
||||
|
@ -69,14 +67,11 @@
|
|||
#define NC_RDF_PAGETITLE_ADDRESSING NC_RDF_PAGETITLE_PREFIX "Addressing"
|
||||
#define NC_RDF_PAGETITLE_SMTP NC_RDF_PAGETITLE_PREFIX "SMTP"
|
||||
#define NC_RDF_PAGETITLE_JUNK NC_RDF_PAGETITLE_PREFIX "Junk"
|
||||
#define NC_RDF_PAGETITLE_FAKEACCOUNT NC_RDF_PAGETITLE_PREFIX "FakeAccount"
|
||||
#define NC_RDF_PAGETAG NC_NAMESPACE_URI "PageTag"
|
||||
|
||||
|
||||
#define NC_RDF_ACCOUNTROOT "msgaccounts:/"
|
||||
|
||||
#define PREF_SHOW_FAKE_ACCOUNT "mailnews.fakeaccount.show"
|
||||
|
||||
typedef struct _serverCreationParams {
|
||||
nsISupportsArray *serverArray;
|
||||
nsIRDFService *rdfService;
|
||||
|
@ -122,7 +117,6 @@ nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleDiskSpace=nsnull;
|
|||
nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleAddressing=nsnull;
|
||||
nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleSMTP=nsnull;
|
||||
nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleJunk=nsnull;
|
||||
nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleFakeAccount=nsnull;
|
||||
|
||||
// common literals
|
||||
nsIRDFLiteral* nsMsgAccountManagerDataSource::kTrueLiteral = nsnull;
|
||||
|
@ -194,8 +188,6 @@ nsMsgAccountManagerDataSource::nsMsgAccountManagerDataSource()
|
|||
&kNC_PageTitleSMTP);
|
||||
getRDFService()->GetResource(NS_LITERAL_CSTRING(NC_RDF_PAGETITLE_JUNK),
|
||||
&kNC_PageTitleJunk);
|
||||
getRDFService()->GetResource(NS_LITERAL_CSTRING(NC_RDF_PAGETITLE_FAKEACCOUNT),
|
||||
&kNC_PageTitleFakeAccount);
|
||||
|
||||
getRDFService()->GetResource(NS_LITERAL_CSTRING(NC_RDF_ACCOUNTROOT),
|
||||
&kNC_AccountRoot);
|
||||
|
@ -209,10 +201,6 @@ nsMsgAccountManagerDataSource::nsMsgAccountManagerDataSource()
|
|||
|
||||
kDefaultServerAtom = NS_NewAtom("DefaultServer");
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrefBranch2> prefBranchInternal(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (prefBranchInternal)
|
||||
prefBranchInternal->AddObserver(PREF_SHOW_FAKE_ACCOUNT, this, PR_FALSE);
|
||||
}
|
||||
|
||||
nsMsgAccountManagerDataSource::~nsMsgAccountManagerDataSource()
|
||||
|
@ -245,7 +233,6 @@ nsMsgAccountManagerDataSource::~nsMsgAccountManagerDataSource()
|
|||
NS_IF_RELEASE(kNC_PageTitleAddressing);
|
||||
NS_IF_RELEASE(kNC_PageTitleSMTP);
|
||||
NS_IF_RELEASE(kNC_PageTitleJunk);
|
||||
NS_IF_RELEASE(kNC_PageTitleFakeAccount);
|
||||
NS_IF_RELEASE(kTrueLiteral);
|
||||
|
||||
NS_IF_RELEASE(kNC_AccountRoot);
|
||||
|
@ -354,25 +341,6 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
|
|||
mStringBundle->GetStringFromName(NS_LITERAL_STRING("prefPanel-junk").get(),
|
||||
getter_Copies(pageTitle));
|
||||
|
||||
else if (source == kNC_PageTitleFakeAccount) {
|
||||
PRBool showFakeAccount;
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = prefBranch->GetBoolPref(PREF_SHOW_FAKE_ACCOUNT, &showFakeAccount);
|
||||
|
||||
if (showFakeAccount) {
|
||||
nsCOMPtr<nsIStringBundleService> strBundleService =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIStringBundle> bundle;
|
||||
rv = strBundleService->CreateBundle("chrome://messenger/locale/fakeAccount.properties",
|
||||
getter_AddRefs(bundle));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
bundle->GetStringFromName(NS_LITERAL_STRING("prefPanel-fake-account").get(),
|
||||
getter_Copies(pageTitle));
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
// if it's a server, use the pretty name
|
||||
nsCOMPtr<nsIMsgFolder> folder = do_QueryInterface(source, &rv);
|
||||
|
@ -439,8 +407,6 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
|
|||
str.AssignLiteral("am-smtp.xul");
|
||||
else if (source == kNC_PageTitleJunk)
|
||||
str.AssignLiteral("am-junk.xul");
|
||||
else if (source == kNC_PageTitleFakeAccount)
|
||||
str.AssignLiteral("am-fakeaccount.xul");
|
||||
else {
|
||||
nsCOMPtr<nsIMsgFolder> folder = do_QueryInterface(source, &rv);
|
||||
if (NS_SUCCEEDED(rv) && folder) {
|
||||
|
@ -481,7 +447,6 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
|
|||
// - "Local Folders" account
|
||||
// - news accounts
|
||||
// - smtp settings (note, this is only in account manager tree)
|
||||
// - fake account
|
||||
|
||||
// make sure we're handling a root folder that is a server
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
|
@ -526,8 +491,6 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
|
|||
if (sourceValue && (strncmp(sourceValue, NC_RDF_PAGETITLE_PREFIX, strlen(NC_RDF_PAGETITLE_PREFIX)) == 0)) {
|
||||
if (source == kNC_PageTitleSMTP)
|
||||
str.AssignLiteral("4000");
|
||||
else if (source == kNC_PageTitleFakeAccount)
|
||||
str.AssignLiteral("5000");
|
||||
else if (source == kNC_PageTitleServer)
|
||||
str.AssignLiteral("1");
|
||||
else if (source == kNC_PageTitleCopies)
|
||||
|
@ -600,10 +563,7 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
|
|||
if (canGetIncomingMessages(server))
|
||||
str.AssignLiteral("true");
|
||||
}
|
||||
else if (property == kNC_PageTitleFakeAccount) {
|
||||
if (source == kNC_PageTitleFakeAccount)
|
||||
str.AssignLiteral("true");
|
||||
}
|
||||
|
||||
if (!str.IsEmpty())
|
||||
rv = createNode(str.get(), target, getRDFService());
|
||||
|
||||
|
@ -670,14 +630,9 @@ nsMsgAccountManagerDataSource::createRootResources(nsIRDFResource *property,
|
|||
printf("GetTargets(): added %d servers on %s\n", nodecount,
|
||||
(const char*)property_arc);
|
||||
#endif
|
||||
// for the "settings" arc, we also want to add SMTP setting and the fake account (if required)
|
||||
// For the "settings" arc, we also want to add SMTP setting.
|
||||
if (property == kNC_Settings) {
|
||||
aNodeArray->AppendElement(kNC_PageTitleSMTP);
|
||||
if (IsFakeAccountRequired())
|
||||
aNodeArray->AppendElement(kNC_PageTitleFakeAccount);
|
||||
}
|
||||
else if (property == kNC_Child && IsFakeAccountRequired()) {
|
||||
aNodeArray->AppendElement(kNC_PageTitleFakeAccount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1229,14 +1184,6 @@ nsMsgAccountManagerDataSource::OnServerLoaded(nsIMsgIncomingServer* aServer)
|
|||
NotifyObservers(kNC_AccountRoot, kNC_Child, serverResource, nsnull, PR_TRUE, PR_FALSE);
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Settings, serverResource, nsnull, PR_TRUE, PR_FALSE);
|
||||
|
||||
PRBool fakeAccountServer;
|
||||
IsIncomingServerForFakeAccount(aServer, &fakeAccountServer);
|
||||
|
||||
if (fakeAccountServer) {
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Child, kNC_PageTitleFakeAccount, nsnull, PR_FALSE, PR_FALSE);
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Settings, kNC_PageTitleFakeAccount, nsnull, PR_FALSE, PR_FALSE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1319,92 +1266,10 @@ nsMsgAccountManagerDataSource::OnItemIntPropertyChanged(nsIMsgFolder *, nsIAtom
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsMsgAccountManagerDataSource::IsFakeAccountRequired()
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
|
||||
PRBool showFakeAccount = PR_FALSE;
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = prefBranch->GetBoolPref(PREF_SHOW_FAKE_ACCOUNT, &showFakeAccount);
|
||||
|
||||
if (!showFakeAccount)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCString fakeHostName;
|
||||
rv = GetFakeAccountHostName(getter_Copies(fakeHostName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr<nsIMsgAccountManager> accountManager = do_QueryReferent(mAccountManager);
|
||||
if (!accountManager)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
|
||||
if (!fakeHostName.IsEmpty()) {
|
||||
rv = accountManager->FindServer(EmptyCString(), fakeHostName, EmptyCString(), getter_AddRefs(server));
|
||||
if (NS_SUCCEEDED(rv) && server)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMsgAccountManagerDataSource::IsIncomingServerForFakeAccount(nsIMsgIncomingServer* aServer, PRBool *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aServer);
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
nsresult rv;
|
||||
nsCString fakeAccountHostName;
|
||||
rv = GetFakeAccountHostName(getter_Copies(fakeAccountHostName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (fakeAccountHostName.IsEmpty())
|
||||
{
|
||||
*aResult = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCString hostname;
|
||||
rv = aServer->GetHostName(hostname);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
*aResult = hostname.Equals(fakeAccountHostName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsMsgAccountManagerDataSource::GetFakeAccountHostName(char **aHostName)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aHostName);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = prefBranch->GetCharPref("mailnews.fakeaccount.server", aHostName);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgAccountManagerDataSource::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
|
||||
{
|
||||
nsMsgRDFDataSource::Observe(aSubject, aTopic, aData);
|
||||
|
||||
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
|
||||
nsDependentString prefName(aData);
|
||||
if (prefName.EqualsLiteral(PREF_SHOW_FAKE_ACCOUNT)) {
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Child, kNC_PageTitleFakeAccount, nsnull, PR_FALSE, PR_FALSE);
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Settings, kNC_PageTitleFakeAccount, nsnull, PR_FALSE, PR_FALSE);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
|
||||
nsCOMPtr<nsIPrefBranch2> prefBranchInternal = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (prefBranchInternal)
|
||||
prefBranchInternal->RemoveObserver(PREF_SHOW_FAKE_ACCOUNT, this);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,10 +122,6 @@ protected:
|
|||
nsresult appendGenericSettingsResources(nsIMsgIncomingServer *server, nsISupportsArray *aNodeArray);
|
||||
nsresult appendGenericSetting(const char *name, nsISupportsArray *aNodeArray);
|
||||
|
||||
PRBool IsFakeAccountRequired();
|
||||
nsresult GetFakeAccountHostName(char **aHostName);
|
||||
nsresult IsIncomingServerForFakeAccount(nsIMsgIncomingServer* aServer, PRBool *aResult);
|
||||
|
||||
static nsIRDFResource* kNC_Name;
|
||||
static nsIRDFResource* kNC_FolderTreeName;
|
||||
static nsIRDFResource* kNC_FolderTreeSimpleName;
|
||||
|
@ -154,7 +150,6 @@ protected:
|
|||
static nsIRDFResource* kNC_PageTitleAddressing;
|
||||
static nsIRDFResource* kNC_PageTitleSMTP;
|
||||
static nsIRDFResource* kNC_PageTitleJunk;
|
||||
static nsIRDFResource* kNC_PageTitleFakeAccount;
|
||||
|
||||
static nsIRDFLiteral* kTrueLiteral;
|
||||
|
||||
|
@ -182,4 +177,4 @@ private:
|
|||
nsCOMPtr<nsIStringBundle> mStringBundle;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* __nsMsgAccountManagerDS_h */
|
||||
|
|
|
@ -394,22 +394,58 @@ NS_IMETHODIMP nsSpamSettings::Initialize(nsIMsgIncomingServer *aServer)
|
|||
nsCOMPtr<nsIMsgAccountManager>
|
||||
accountManager(do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsISupportsArray> identities;
|
||||
rv = accountManager->GetIdentitiesForServer(aServer, getter_AddRefs(identities));
|
||||
|
||||
nsCOMPtr<nsIMsgAccount> account;
|
||||
rv = accountManager->FindAccountForServer(aServer, getter_AddRefs(account));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRUint32 count = 0;
|
||||
identities->Count(&count);
|
||||
nsCAutoString accountKey;
|
||||
rv = account->GetKey(accountKey);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Loop through all accounts, adding emails from this account, as well as
|
||||
// from any accounts that defer to this account.
|
||||
mEmails.Clear();
|
||||
mEmails.SetCapacity(count);
|
||||
for (PRUint32 index = 0; index < count; ++index)
|
||||
nsCOMPtr<nsISupportsArray> accounts;
|
||||
rv = accountManager->GetAccounts(getter_AddRefs(accounts));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
PRUint32 accountCount;
|
||||
accounts->Count(&accountCount);
|
||||
|
||||
for (PRUint32 i = 0; i < accountCount; i++)
|
||||
{
|
||||
nsCOMPtr<nsIMsgIdentity> identity(do_QueryElementAt(identities, index));
|
||||
if (!identity)
|
||||
nsCOMPtr<nsIMsgAccount> loopAccount(do_QueryElementAt(accounts, i));
|
||||
if (!loopAccount)
|
||||
continue;
|
||||
nsCAutoString email;
|
||||
rv = identity->GetEmail(email);
|
||||
mEmails.AppendElement(email);
|
||||
nsCAutoString loopAccountKey;
|
||||
loopAccount->GetKey(loopAccountKey);
|
||||
nsCOMPtr<nsIMsgIncomingServer> loopServer;
|
||||
loopAccount->GetIncomingServer(getter_AddRefs(loopServer));
|
||||
nsCAutoString deferredToAccountKey;
|
||||
if (loopServer)
|
||||
loopServer->GetCharValue("deferred_to_account", deferredToAccountKey);
|
||||
|
||||
// Add the emails for any account that defers to this one, or for the
|
||||
// account itself.
|
||||
if (accountKey.Equals(deferredToAccountKey) || accountKey.Equals(loopAccountKey))
|
||||
{
|
||||
nsCOMPtr<nsISupportsArray> identities;
|
||||
loopAccount->GetIdentities(getter_AddRefs(identities));
|
||||
if (!identities)
|
||||
continue;
|
||||
PRUint32 identityCount = 0;
|
||||
identities->Count(&identityCount);
|
||||
for (PRUint32 j = 0; j < identityCount; ++j)
|
||||
{
|
||||
nsCOMPtr<nsIMsgIdentity> identity(do_QueryElementAt(identities, j));
|
||||
if (!identity)
|
||||
continue;
|
||||
nsCAutoString email;
|
||||
identity->GetEmail(email);
|
||||
if (!email.IsEmpty())
|
||||
mEmails.AppendElement(email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,9 @@
|
|||
// add address book setup
|
||||
load("../../mailnews/resources/abSetup.js");
|
||||
|
||||
const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
|
||||
.getService(Ci.nsIMsgCopyService);
|
||||
// add fake POP3 server driver
|
||||
load("../../mailnews/resources/POP3pump.js");
|
||||
|
||||
const prefs = Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(Ci.nsIPrefBranch);
|
||||
|
||||
|
@ -72,7 +73,6 @@ let hdrs = [];
|
|||
|
||||
function run_test()
|
||||
{
|
||||
loadLocalMailAccount();
|
||||
|
||||
// Test setup - copy the data file into place
|
||||
var testAB = do_get_file("../../test_addbook/unit/data/cardForEmail.mab");
|
||||
|
@ -80,35 +80,32 @@ function run_test()
|
|||
// Copy the file to the profile directory for a PAB (this is the personal address book)
|
||||
testAB.copyTo(gProfileDir, kPABData.fileName);
|
||||
|
||||
var copyListener =
|
||||
{
|
||||
OnStartCopy: function() {},
|
||||
OnProgress: function(aProgress, aProgressMax) {},
|
||||
SetMessageKey: function(aKey) { hdrs.push(gLocalInboxFolder.GetMessageHeader(aKey));},
|
||||
SetMessageId: function(aMessageId) {},
|
||||
OnStopCopy: function _OnStopCopy(aStatus)
|
||||
{
|
||||
var fileName = Files.shift();
|
||||
if (fileName)
|
||||
{
|
||||
var file = do_get_file(fileName);
|
||||
copyService.CopyFileMessage(file, gLocalInboxFolder, null, false, 0,
|
||||
"", copyListener, null);
|
||||
}
|
||||
else
|
||||
continueTest();
|
||||
}
|
||||
};
|
||||
|
||||
do_test_pending();
|
||||
|
||||
|
||||
// kick off copying
|
||||
copyListener.OnStopCopy(null);
|
||||
gPOP3Pump.files = Files;
|
||||
gPOP3Pump.onDone = "continueTest();";
|
||||
gPOP3Pump.run();
|
||||
}
|
||||
|
||||
function continueTest()
|
||||
{
|
||||
let server = gLocalInboxFolder.server;
|
||||
// get the message headers
|
||||
let headerEnum = gLocalInboxFolder.messages;
|
||||
while (headerEnum.hasMoreElements())
|
||||
hdrs.push(headerEnum.getNext().QueryInterface(Ci.nsIMsgDBHdr));
|
||||
|
||||
// check with spam properties set on the local server
|
||||
doChecks(gLocalIncomingServer);
|
||||
|
||||
// Free our globals
|
||||
hdrs = null;
|
||||
gPOP3Pump = null;
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
function doChecks(server)
|
||||
{
|
||||
let spamSettings = server.spamSettings;
|
||||
|
||||
// default is to use the whitelist
|
||||
|
@ -132,7 +129,7 @@ function continueTest()
|
|||
server.setBoolValue("useWhiteList", false);
|
||||
spamSettings.initialize(server);
|
||||
|
||||
// check that the change was propogated to spamSettings
|
||||
// check that the change was propagated to spamSettings
|
||||
do_check_false(spamSettings.useWhiteList);
|
||||
|
||||
// and affects whitelisting calculationss
|
||||
|
@ -183,6 +180,20 @@ function continueTest()
|
|||
identity.email = "iAmNotTheSender@test.invalid";
|
||||
account.addIdentity(identity);
|
||||
|
||||
// setup account and identify for the deferred-from fake server
|
||||
let fakeAccount = accountManager.createAccount();
|
||||
fakeAccount.incomingServer = gPOP3Pump.fakeServer;
|
||||
let fakeIdentity = accountManager.createIdentity();
|
||||
// start with an email that does not match
|
||||
fakeIdentity.email = "iAmNotTheSender@wrong.domain";
|
||||
fakeAccount.addIdentity(fakeIdentity);
|
||||
|
||||
// gPOP3Pump delivers messages to the local inbox regardless of other
|
||||
// settings. But because we are testing here one of those other settings,
|
||||
// let's just pretend that it works like the real POP3 stuff, and set
|
||||
// the correct setting for deferring.
|
||||
gPOP3Pump.fakeServer.setCharValue("deferred_to_account", "account1");
|
||||
|
||||
// suppress whitelisting for sender
|
||||
server.setBoolValue("inhibitWhiteListingIdentityUser", true);
|
||||
spamSettings.initialize(server);
|
||||
|
@ -194,11 +205,24 @@ function continueTest()
|
|||
spamSettings.initialize(server);
|
||||
do_check_false(spamSettings.checkWhiteList(hdrs[kDomainTest]));
|
||||
|
||||
// remove the matching email
|
||||
identity.email = "iAmNotTheSender@test.invalid";
|
||||
spamSettings.initialize(server);
|
||||
do_check_true(spamSettings.checkWhiteList(hdrs[kDomainTest]));
|
||||
|
||||
// add the email to the deferred-from server
|
||||
fakeIdentity.email = "PrimaryEMAIL1@test.INVALID";
|
||||
spamSettings.initialize(server);
|
||||
do_check_false(spamSettings.checkWhiteList(hdrs[kDomainTest]));
|
||||
|
||||
// stop suppressing identity users
|
||||
server.setBoolValue("inhibitWhiteListingIdentityUser", false);
|
||||
spamSettings.initialize(server);
|
||||
do_check_true(spamSettings.checkWhiteList(hdrs[kDomainTest]));
|
||||
|
||||
// remove the matching email from the fake identity
|
||||
fakeIdentity.email = "iAmNotTheSender@wrong.domain";
|
||||
|
||||
// add a fully non-matching domain to the identity
|
||||
identity.email = "PrimaryEmail1@wrong.domain";
|
||||
|
||||
|
@ -217,10 +241,5 @@ function continueTest()
|
|||
server.setBoolValue("inhibitWhiteListingIdentityDomain", false);
|
||||
spamSettings.initialize(server);
|
||||
do_check_true(spamSettings.checkWhiteList(hdrs[kDomainTest]));
|
||||
|
||||
// Free our globals
|
||||
hdrs = null;
|
||||
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
|
|
|
@ -755,9 +755,6 @@ pref("mailnews.labels.color.5", "#993399"); // default: purple
|
|||
//example "X-Warn: XReply", list of hdrs separated by ": "
|
||||
pref("mailnews.customHeaders", "");
|
||||
|
||||
pref("mailnews.fakeaccount.show", false);
|
||||
pref("mailnews.fakeaccount.server", "");
|
||||
|
||||
// default msg compose font prefs
|
||||
pref("msgcompose.font_face", "");
|
||||
pref("msgcompose.font_size", "medium");
|
||||
|
|
Загрузка…
Ссылка в новой задаче