168533 backing out this needs to go with other filter enhancements

This commit is contained in:
naving%netscape.com 2002-09-23 03:11:10 +00:00
Родитель d8400f3051
Коммит b846d70fad
6 изменённых файлов: 10 добавлений и 43 удалений

Просмотреть файл

@ -154,7 +154,7 @@ function setServer(uri)
var resource = gRDF.GetResource(uri);
var msgFolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder);
//Calling getFilterList will detect any errors in rules1.dat, backup the file, and alert the user
//Calling getFilterList will detect any errors in rules.dat, backup the file, and alert the user
//we need to do this because gFilterTree.setAttribute will cause rdf to call getFilterList and there is
//no way to pass msgWindow in that case.

Просмотреть файл

@ -6,10 +6,10 @@ cannotHaveDuplicateFilterTitle=Duplicate Filter Name
cannotHaveDuplicateFilterMessage=The filter name you entered already exists. Please enter a different filter name.
deleteFilterConfirmation=Are you sure you want to delete this filter?
untitledFilterName=untitled filter
filterListBackUpMsg=Your filters do not work because the rules1.dat file, which contains your filters, could not be read. A new rules1.dat file will be created and a backup of the old file, called rulesbackup.dat, will be created in the same directory.
filterListBackUpMsg=Your filters do not work because the rules.dat file, which contains your filters, could not be read. A new rules.dat file will be created and a backup of the old file, called rulesbackup.dat, will be created in the same directory.
customHeaderOverflow=You've exceeded the limit of 50 custom headers. Please remove one or more custom headers and try again.
filterCustomHeaderOverflow=Your filters have exceeded the limit of 50 custom headers. Please edit the rules1.dat file, which contains your filters, to use fewer custom headers.
invalidCustomHeader=One of your filters uses a custom header that contains an invalid character, such as ':', a non-printable character, a non-ascii character, or an eight-bit ascii character. Please edit the rules1.dat file, which contains your filters, to remove invalid characters from your custom headers.
filterCustomHeaderOverflow=Your filters have exceeded the limit of 50 custom headers. Please edit the rules.dat file, which contains your filters, to use fewer custom headers.
invalidCustomHeader=One of your filters uses a custom header that contains an invalid character, such as ':', a non-printable character, a non-ascii character, or an eight-bit ascii character. Please edit the rules.dat file, which contains your filters, to remove invalid characters from your custom headers.
continueFilterExecution=Applying filter %S failed. Would you like to continue applying filters?
promptTitle=Running Filters
promptMsg=You are currently in the process of filtering messages.\nWould you like to continue applying filters?

Просмотреть файл

@ -186,8 +186,8 @@ NS_IMETHODIMP nsMsgFilterService::SaveFilterList(nsIMsgFilterList *filterList, n
filterFile->GetLeafName(getter_Copies(finalLeafName));
if (!finalLeafName.IsEmpty())
parentDir->Rename(finalLeafName);
else // fall back to rules1.dat
parentDir->Rename("rules1.dat");
else // fall back to rules.dat
parentDir->Rename("rules.dat");
tmpFiltersFile->Delete(PR_FALSE);
}

Просмотреть файл

@ -131,7 +131,7 @@ static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
#define DEFAULT_4X_TEMPLATES_FOLDER_NAME "Templates"
#define UNSENT_MESSAGES_FOLDER_NAME "Unsent%20Messages"
#define FILTER_FILE_NAME "rules1.dat" /* this uses a cross-platform file format */
#define FILTER_FILE_NAME "rules.dat" /* this is XP in 5.x */
/* we are going to clear these after migration */
#define PREF_4X_MAIL_IDENTITY_USEREMAIL "mail.identity.useremail"

Просмотреть файл

@ -1083,40 +1083,8 @@ nsMsgIncomingServer::GetFilterList(nsIMsgWindow *aMsgWindow, nsIMsgFilterList **
rv = mFilterFile->FromFileSpec(thisFolder);
NS_ENSURE_SUCCESS(rv, rv);
mFilterFile->AppendRelativeUnixPath("rules1.dat");
PRBool fileExists;
mFilterFile->Exists(&fileExists);
if (!fileExists)
{
nsCOMPtr<nsIFileSpec> oldFilterFile = do_CreateInstance(NS_FILESPEC_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = oldFilterFile->FromFileSpec(thisFolder);
NS_ENSURE_SUCCESS(rv, rv);
oldFilterFile->AppendRelativeUnixPath("rules.dat");
oldFilterFile->Exists(&fileExists);
if (fileExists) //copy rules.dat --> rules1.dat
{
nsFileSpec rootFolderSpec;
thisFolder->GetFileSpec(&rootFolderSpec);
nsCOMPtr<nsILocalFile> rootFolderDir;
rv = NS_FileSpecToIFile(&rootFolderSpec, getter_AddRefs(rootFolderDir));
NS_ENSURE_SUCCESS(rv, rv);
nsFileSpec oldFilterSpec;
oldFilterFile->GetFileSpec(&oldFilterSpec);
nsCOMPtr<nsILocalFile> localFilterFile;
rv = NS_FileSpecToIFile(&oldFilterSpec, getter_AddRefs(localFilterFile));
NS_ENSURE_SUCCESS(rv, rv);
rv = localFilterFile->CopyToNative(rootFolderDir, NS_LITERAL_CSTRING("rules1.dat"));
NS_ENSURE_SUCCESS(rv, rv);
}
}
mFilterFile->AppendRelativeUnixPath("rules.dat");
nsCOMPtr<nsIMsgFilterService> filterService =
do_GetService(NS_MSGFILTERSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -189,8 +189,7 @@ nsShouldIgnoreFile(nsString& name)
if (firstChar == '.' || firstChar == '#' || name.CharAt(name.Length() - 1) == '~')
return PR_TRUE;
if (name.EqualsIgnoreCase("rules1.dat") ||
name.EqualsIgnoreCase("rules.dat") ||
if (name.EqualsIgnoreCase("rules.dat") ||
name.EqualsIgnoreCase("filterlog.html") ||
name.EqualsIgnoreCase("rulesbackup.dat"))
return PR_TRUE;