Bug 1334834 - remove use of nsIAtom from mailnews/nsIFolder*.idl. r=aceman
authorJorg K <jorgk@jorgk.com>
Sat, 26 Aug 2017 12:18:00 +0200
changeset 29630 93d7402586ec2b1f30de938083d5cdb10d0b3741
parent 29629 902ced95970415d12786f23af1292c5fd3800971
child 29631 9df74592471ab94f262e59b2de5394202b4e74d4
push id378
push userclokep@gmail.com
push dateMon, 13 Nov 2017 18:45:35 +0000
reviewersaceman
bugs1334834
Bug 1334834 - remove use of nsIAtom from mailnews/nsIFolder*.idl. r=aceman
mailnews/addrbook/src/nsAbView.h
mailnews/base/public/nsIFolderListener.idl
mailnews/base/public/nsIMsgAccountManager.idl
mailnews/base/public/nsIMsgFolder.idl
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMessenger.h
mailnews/base/src/nsMessengerOSXIntegration.h
mailnews/base/src/nsMessengerOSXIntegration.mm
mailnews/base/src/nsMessengerUnixIntegration.cpp
mailnews/base/src/nsMessengerUnixIntegration.h
mailnews/base/src/nsMessengerWinIntegration.cpp
mailnews/base/src/nsMessengerWinIntegration.h
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgAccountManager.h
mailnews/base/src/nsMsgAccountManagerDS.cpp
mailnews/base/src/nsMsgAccountManagerDS.h
mailnews/base/src/nsMsgDBView.h
mailnews/base/src/nsMsgFolderDataSource.cpp
mailnews/base/src/nsMsgFolderDataSource.h
mailnews/base/src/nsMsgMailSession.cpp
mailnews/base/src/nsMsgStatusFeedback.cpp
mailnews/base/src/nsMsgStatusFeedback.h
mailnews/base/src/nsMsgWindow.h
mailnews/base/src/nsStatusBarBiffManager.cpp
mailnews/base/src/nsStatusBarBiffManager.h
mailnews/base/util/moz.build
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgDBFolder.h
mailnews/base/util/nsMsgDBFolderAtomList.h
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/compose/src/nsMsgSendLater.h
mailnews/imap/src/nsImapIncomingServer.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsLocalUndoTxn.cpp
mailnews/local/src/nsPop3IncomingServer.cpp
mailnews/news/src/nsNewsFolder.cpp
mailnews/news/src/nsNntpIncomingServer.cpp
mailnews/news/src/nsNntpIncomingServer.h
--- a/mailnews/addrbook/src/nsAbView.h
+++ b/mailnews/addrbook/src/nsAbView.h
@@ -9,17 +9,16 @@
 #include "nsISupports.h"
 #include "nsString.h"
 #include "nsIAbView.h"
 #include "nsITreeView.h"
 #include "nsITreeBoxObject.h"
 #include "nsITreeSelection.h"
 #include "nsTArray.h"
 #include "nsIAbDirectory.h"
-#include "nsIAtom.h"
 #include "nsICollation.h"
 #include "nsIAbListener.h"
 #include "nsIObserver.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMemory.h"
 #include "nsIStringBundle.h"
 
--- a/mailnews/base/public/nsIFolderListener.idl
+++ b/mailnews/base/public/nsIFolderListener.idl
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
-#include "nsIAtom.idl"
 
 interface nsIMsgFolder;
 interface nsIMsgDBHdr;
 
 typedef unsigned long folderListenerNotifyFlagValue;
 
 [scriptable, uuid(f60ee1a2-6d81-422c-958f-d408b1b2daa7)]
 interface nsIFolderListener : nsISupports {
@@ -18,46 +17,46 @@ interface nsIFolderListener : nsISupport
                    in nsISupports aItem);
   
   const folderListenerNotifyFlagValue removed = 0x2;
   void OnItemRemoved(in nsIMsgFolder aParentItem,
                      in nsISupports aItem);
   
   const folderListenerNotifyFlagValue propertyChanged = 0x4;
   void OnItemPropertyChanged(in nsIMsgFolder aItem,
-                             in nsIAtom aProperty,
+                             in ACString aProperty,
                              in string aOldValue,
                              in string aNewValue);
   
   const folderListenerNotifyFlagValue intPropertyChanged = 0x8;
   // While this property handles long long (64bit wide) values,
   // the Javascript engine will only pass values up to 2^53 to the consumers.
   void OnItemIntPropertyChanged(in nsIMsgFolder aItem,
-                                in nsIAtom aProperty,
+                                in ACString aProperty,
                                 in long long aOldValue,
                                 in long long aNewValue);
   
   const folderListenerNotifyFlagValue boolPropertyChanged = 0x10;
   void OnItemBoolPropertyChanged(in nsIMsgFolder aItem,
-                                 in nsIAtom aProperty,
+                                 in ACString aProperty,
                                  in boolean aOldValue,
                                  in boolean aNewValue);
   
   const folderListenerNotifyFlagValue unicharPropertyChanged = 0x20;
   void OnItemUnicharPropertyChanged(in nsIMsgFolder aItem,
-                                    in nsIAtom aProperty,
+                                    in ACString aProperty,
                                     in wstring aOldValue,
                                     in wstring aNewValue);
   
   const folderListenerNotifyFlagValue propertyFlagChanged = 0x40;
   void OnItemPropertyFlagChanged(in nsIMsgDBHdr aItem,
-                                 in nsIAtom aProperty,
+                                 in ACString aProperty,
                                  in unsigned long aOldFlag,
                                  in unsigned long aNewFlag);
 
   const folderListenerNotifyFlagValue event = 0x80;
-  void OnItemEvent(in nsIMsgFolder aItem, in nsIAtom aEvent);
+  void OnItemEvent(in nsIMsgFolder aItem, in ACString aEvent);
   
   const folderListenerNotifyFlagValue all = 0xFFFFFFFF; 
 
   //  void OnFolderLoaded(in nsIMsgFolder aFolder);
   //  void OnDeleteOrMoveMessagesCompleted(in nsIMsgFolder aFolder);
 };
--- a/mailnews/base/public/nsIMsgAccountManager.idl
+++ b/mailnews/base/public/nsIMsgAccountManager.idl
@@ -191,17 +191,18 @@ interface nsIMsgAccountManager : nsISupp
 
   void addRootFolderListener(in nsIFolderListener listener);
   void removeRootFolderListener(in nsIFolderListener listener);
 
   // these are going away in favor of add/removeRootFolderListener
   void addIncomingServerListener(in nsIIncomingServerListener serverListener);
   void removeIncomingServerListener(in nsIIncomingServerListener serverListener);
 
-  // these are going away in favor of nsIMsgFolder::NotifyEvent(in nsIAtom event);
+  // these are going away in favor of nsIMsgFolder::NotifyEvent(in ACString event);
+  // XXX what does this mean? There is no such function yet.
   void notifyServerLoaded(in nsIMsgIncomingServer server);
   void notifyServerUnloaded(in nsIMsgIncomingServer server);
   void notifyServerChanged(in nsIMsgIncomingServer server);
 
   // force account info out to prefs file
   void saveAccountInfo();
 
   ACString getChromePackageName(in ACString aExtensionName);
--- a/mailnews/base/public/nsIMsgFolder.idl
+++ b/mailnews/base/public/nsIMsgFolder.idl
@@ -669,37 +669,37 @@ interface nsIMsgFolder : nsISupports {
    * @param escapedSubFolderName  The name of the sub folder to find.
    * @note                        Even if the folder doesn't currently exist,
    *                              a nsIMsgFolder may be returned.
    */
   nsIMsgFolder findSubFolder(in ACString escapedSubFolderName);
 
   void AddFolderListener(in nsIFolderListener listener);
   void RemoveFolderListener(in nsIFolderListener listener);
-  void NotifyPropertyChanged(in nsIAtom property,
+  void NotifyPropertyChanged(in ACString property,
                              in ACString oldValue,
                              in ACString newValue);
-  void NotifyIntPropertyChanged(in nsIAtom property,
+  void NotifyIntPropertyChanged(in ACString property,
                                 in long long oldValue,
                                 in long long newValue);
-  void NotifyBoolPropertyChanged(in nsIAtom property,
+  void NotifyBoolPropertyChanged(in ACString property,
                                  in boolean oldValue,
                                  in boolean newValue);
   void NotifyPropertyFlagChanged(in nsIMsgDBHdr item,
-                                 in nsIAtom property,
+                                 in ACString property,
                                  in unsigned long oldValue,
                                  in unsigned long newValue);
-  void NotifyUnicharPropertyChanged(in nsIAtom property,
+  void NotifyUnicharPropertyChanged(in ACString property,
                                     in AString oldValue,
                                     in AString newValue);
 
   void NotifyItemAdded(in nsISupports item);
   void NotifyItemRemoved(in nsISupports item);
 
-  void NotifyFolderEvent(in nsIAtom event);
+  void NotifyFolderEvent(in ACString event);
 
   //  void NotifyFolderLoaded();
   //  void NotifyDeleteOrMoveMessagesCompleted(in nsIMsgFolder folder);
 
   // Gets all descendants, not just first level children.
   readonly attribute nsIArray descendants;
   /*
    * Lists all the folders that are subfolders of the current folder,
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -2283,48 +2283,48 @@ NS_IMETHODIMP nsMessenger::OnItemRemoved
         if (mCurHistoryPos >= (int32_t)uriPos)
           mCurHistoryPos -= 2;
       }
     }
   }
   return NS_OK;
 }
 
-/* void OnItemPropertyChanged (in nsIMsgFolder item, in nsIAtom property, in string oldValue, in string newValue); */
-NS_IMETHODIMP nsMessenger::OnItemPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char *oldValue, const char *newValue)
+/* void OnItemPropertyChanged (in nsIMsgFolder item, in ACString property, in string oldValue, in string newValue); */
+NS_IMETHODIMP nsMessenger::OnItemPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char *oldValue, const char *newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* void OnItemIntPropertyChanged (in nsIMsgFolder item, in nsIAtom property, in long long oldValue, in long long newValue); */
-NS_IMETHODIMP nsMessenger::OnItemIntPropertyChanged(nsIMsgFolder *item, nsIAtom *property, int64_t oldValue, int64_t newValue)
+/* void OnItemIntPropertyChanged (in nsIMsgFolder item, in ACString property, in long long oldValue, in long long newValue); */
+NS_IMETHODIMP nsMessenger::OnItemIntPropertyChanged(nsIMsgFolder *item, const nsACString &property, int64_t oldValue, int64_t newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* void OnItemBoolPropertyChanged (in nsIMsgFolder item, in nsIAtom property, in boolean oldValue, in boolean newValue); */
-NS_IMETHODIMP nsMessenger::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
+/* void OnItemBoolPropertyChanged (in nsIMsgFolder item, in ACString property, in boolean oldValue, in boolean newValue); */
+NS_IMETHODIMP nsMessenger::OnItemBoolPropertyChanged(nsIMsgFolder *item, const nsACString &property, bool oldValue, bool newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* void OnItemUnicharPropertyChanged (in nsIMsgFolder item, in nsIAtom property, in wstring oldValue, in wstring newValue); */
-NS_IMETHODIMP nsMessenger::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
+/* void OnItemUnicharPropertyChanged (in nsIMsgFolder item, in ACString property, in wstring oldValue, in wstring newValue); */
+NS_IMETHODIMP nsMessenger::OnItemUnicharPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue, const char16_t *newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* void OnItemPropertyFlagChanged (in nsIMsgDBHdr item, in nsIAtom property, in unsigned long oldFlag, in unsigned long newFlag); */
-NS_IMETHODIMP nsMessenger::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+/* void OnItemPropertyFlagChanged (in nsIMsgDBHdr item, in ACString property, in unsigned long oldFlag, in unsigned long newFlag); */
+NS_IMETHODIMP nsMessenger::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* void OnItemEvent (in nsIMsgFolder item, in nsIAtom event); */
-NS_IMETHODIMP nsMessenger::OnItemEvent(nsIMsgFolder *item, nsIAtom *event)
+/* void OnItemEvent (in nsIMsgFolder item, in string event); */
+NS_IMETHODIMP nsMessenger::OnItemEvent(nsIMsgFolder *item, const nsACString &event)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 // Detach/Delete Attachments
 ///////////////////////////////////////////////////////////////////////////////
 
--- a/mailnews/base/src/nsMessenger.h
+++ b/mailnews/base/src/nsMessenger.h
@@ -7,16 +7,17 @@
 #define __nsMsgAppCore_h
 
 #include "nscore.h"
 #include "nsIMessenger.h"
 #include "nsCOMPtr.h"
 #include "nsITransactionManager.h"
 #include "nsIFile.h"
 #include "nsIDocShell.h"
+#include "nsString.h"
 #include "nsIStringBundle.h"
 #include "nsIFile.h"
 #include "nsIFilePicker.h"
 #include "nsWeakReference.h"
 #include "mozIDOMWindow.h"
 #include "nsTArray.h"
 #include "nsIFolderListener.h"
 
--- a/mailnews/base/src/nsMessengerOSXIntegration.h
+++ b/mailnews/base/src/nsMessengerOSXIntegration.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __nsMessengerOSXIntegration_h
 #define __nsMessengerOSXIntegration_h
 
 #include "nsIMessengerOSIntegration.h"
 #include "nsIFolderListener.h"
-#include "nsIAtom.h"
 #include "nsITimer.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIObserver.h"
 #include "nsIAlertsService.h"
 #include "mozINewMailListener.h"
 
 #define NS_MESSENGEROSXINTEGRATION_CID \
@@ -35,18 +34,16 @@ public:
   NS_DECL_NSIMESSENGEROSINTEGRATION
   NS_DECL_NSIFOLDERLISTENER
   NS_DECL_NSIOBSERVER
   NS_DECL_MOZINEWMAILLISTENER
 
 private:
   virtual ~nsMessengerOSXIntegration();
 
-  nsCOMPtr<nsIAtom> mBiffStateAtom;
-  nsCOMPtr<nsIAtom> mNewMailReceivedAtom;
   nsresult ShowAlertMessage(const nsAString& aAlertTitle, const nsAString& aAlertText, const nsACString& aFolderURI);
   nsresult OnAlertFinished();
   nsresult OnAlertClicked(const char16_t * aAlertCookie);
 #ifdef MOZ_SUITE
   nsresult OnAlertClickedSimple();
 #endif
   nsresult GetStringBundle(nsIStringBundle **aBundle);
   void FillToolTipInfo(nsIMsgFolder *aFolder, int32_t aNewCount);
--- a/mailnews/base/src/nsMessengerOSXIntegration.mm
+++ b/mailnews/base/src/nsMessengerOSXIntegration.mm
@@ -7,19 +7,20 @@
 #include "nsMsgUtils.h"
 #include "nsArrayUtils.h"
 #include "nsMessengerOSXIntegration.h"
 #include "nsIMsgMailSession.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsIMsgIdentity.h"
 #include "nsIMsgAccount.h"
 #include "nsIMsgFolder.h"
+#include "nsMsgFolderFlags.h"
+#include "nsMsgDBFolder.h"
 #include "nsCOMPtr.h"
 #include "nsMsgBaseCID.h"
-#include "nsMsgFolderFlags.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDirectoryService.h"
 #include "MailNewsTypes.h"
 #include "nsIWindowMediator.h"
 #include "nsIDOMChromeWindow.h"
 #include "mozIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
@@ -154,18 +155,16 @@ static void openMailWindow(const nsCStri
     if (messengerWindowService)
       messengerWindowService->OpenMessengerWindowWithUri(
                                 "mail:3pane", aUri.get(), nsMsgKey_None);
   }
 }
 
 nsMessengerOSXIntegration::nsMessengerOSXIntegration()
 {
-  mBiffStateAtom = MsgGetAtom("BiffState");
-  mNewMailReceivedAtom = MsgGetAtom("NewMailReceived");
   mUnreadTotal = 0;
   mUnreadChat = 0;
 }
 
 nsMessengerOSXIntegration::~nsMessengerOSXIntegration()
 {
   RestoreDockIcon();
 }
@@ -187,23 +186,23 @@ nsMessengerOSXIntegration::Init()
 {
   nsresult rv;
   nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return observerService->AddObserver(this, "mail-startup-done", false);
 }
 
 NS_IMETHODIMP
-nsMessengerOSXIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
+nsMessengerOSXIntegration::OnItemPropertyChanged(nsIMsgFolder *, const nsACString &, char const *, char const *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerOSXIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
+nsMessengerOSXIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, const nsACString &, const char16_t *, const char16_t *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
@@ -405,17 +404,17 @@ nsMessengerOSXIntegration::ShowAlertMess
   if (NS_FAILED(rv))
     OnAlertFinished();
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemIntPropertyChanged(nsIMsgFolder *aFolder,
-                                                    nsIAtom *aProperty,
+                                                    const nsACString &aProperty,
                                                     int64_t aOldValue,
                                                     int64_t aNewValue)
 {
   // if we got new mail show an alert
   if (aNewValue == nsIMsgFolder::nsMsgBiffState_NewMail)
   {
     bool performingBiff = false;
     nsCOMPtr<nsIMsgIncomingServer> server;
@@ -433,17 +432,17 @@ nsMessengerOSXIntegration::OnItemIntProp
                                            getter_AddRefs(childFolder));
     if (NS_FAILED(rv) || !childFolder)
       return NS_ERROR_FAILURE;
 
     int32_t numNewMessages = 0;
     childFolder->GetNumNewMessages(true, &numNewMessages);
     FillToolTipInfo(childFolder, numNewMessages);
   }
-  else if (mNewMailReceivedAtom == aProperty)
+  else if (aProperty.Equals(kNewMailReceived))
   {
     FillToolTipInfo(aFolder, aNewValue);
   }
   return NS_OK;
 }
 
 nsresult
 nsMessengerOSXIntegration::OnAlertClicked(const char16_t* aAlertCookie)
@@ -560,38 +559,38 @@ nsMessengerOSXIntegration::BadgeDockIcon
   id tile = [[NSApplication sharedApplication] dockTile];
   [tile setBadgeLabel:[NSString stringWithFormat:@"%S", (const unichar*)badgeString.get()]];
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP
-nsMessengerOSXIntegration::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+nsMessengerOSXIntegration::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemAdded(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemBoolPropertyChanged(nsIMsgFolder *aItem,
-                                                         nsIAtom *aProperty,
-                                                         bool aOldValue,
-                                                         bool aNewValue)
+                                                     const nsACString &aProperty,
+                                                     bool aOldValue,
+                                                     bool aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerOSXIntegration::OnItemEvent(nsIMsgFolder *, nsIAtom *)
+nsMessengerOSXIntegration::OnItemEvent(nsIMsgFolder *, const nsACString &)
 {
   return NS_OK;
 }
 
 nsresult
 nsMessengerOSXIntegration::GetNewMailAuthors(nsIMsgFolder* aFolder,
                                              nsString& aAuthors,
                                              int32_t aNewCount,
--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -38,16 +38,17 @@
 #include "prmem.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIWeakReferenceUtils.h"
 
 #include "nsNativeCharsetUtils.h"
 #include "nsToolkitCompsCID.h"
 #include "nsMsgUtils.h"
+#include "nsMsgDBFolder.h"
 #include "msgCore.h"
 #include "nsCOMArray.h"
 #include "nsIMutableArray.h"
 #include "nsArrayUtils.h"
 #include "nsMemory.h"
 #include "mozilla/Services.h"
 #include "mozilla/mailnews/MimeHeaderParser.h"
 
@@ -100,18 +101,16 @@ static void openMailWindow(const nsACStr
     if (messengerWindowService)
       messengerWindowService->OpenMessengerWindowWithUri(
                                 "mail:3pane", nsCString(aFolderUri).get(), nsMsgKey_None);
   }
 }
 
 nsMessengerUnixIntegration::nsMessengerUnixIntegration()
 {
-  mBiffStateAtom = MsgGetAtom("BiffState");
-  mNewMailReceivedAtom = MsgGetAtom("NewMailReceived");
   mAlertInProgress = false;
   mFoldersWithNewMail = do_CreateInstance(NS_ARRAY_CONTRACTID);
 }
 
 NS_IMPL_ISUPPORTS(nsMessengerUnixIntegration, nsIFolderListener, nsIObserver,
                    nsIMessengerOSIntegration, nsIUrlListener)
 
 nsresult
@@ -120,23 +119,23 @@ nsMessengerUnixIntegration::Init()
   nsresult rv;
 
   nsCOMPtr<nsIMsgMailSession> mailSession = do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
   return mailSession->AddFolderListener(this, nsIFolderListener::intPropertyChanged);
 }
 
 NS_IMETHODIMP
-nsMessengerUnixIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
+nsMessengerUnixIntegration::OnItemPropertyChanged(nsIMsgFolder *, const nsACString &, char const *, char const *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerUnixIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
+nsMessengerUnixIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, const nsACString &, const char16_t *, const char16_t *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerUnixIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
@@ -639,48 +638,48 @@ nsresult nsMessengerUnixIntegration::Get
     }  // if we have more potential folders to enumerate
   }
 
   // If we got here, then something when pretty wrong.
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsMessengerUnixIntegration::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+nsMessengerUnixIntegration::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerUnixIntegration::OnItemAdded(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerUnixIntegration::OnItemBoolPropertyChanged(nsIMsgFolder *aItem,
-                                                         nsIAtom *aProperty,
-                                                         bool aOldValue,
-                                                         bool aNewValue)
+                                                      const nsACString &aProperty,
+                                                      bool aOldValue,
+                                                      bool aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerUnixIntegration::OnItemEvent(nsIMsgFolder *, nsIAtom *)
+nsMessengerUnixIntegration::OnItemEvent(nsIMsgFolder *, const nsACString &)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerUnixIntegration::OnItemIntPropertyChanged(nsIMsgFolder *aItem, nsIAtom *aProperty, int64_t aOldValue, int64_t aNewValue)
+nsMessengerUnixIntegration::OnItemIntPropertyChanged(nsIMsgFolder *aItem, const nsACString &aProperty, int64_t aOldValue, int64_t aNewValue)
 {
   nsCString atomName;
   // if we got new mail show an icon in the system tray
-  if (mBiffStateAtom == aProperty && mFoldersWithNewMail)
+  if (aProperty.Equals(kBiffState) && mFoldersWithNewMail)
   {
     nsCOMPtr<nsIWeakReference> weakFolder = do_GetWeakReference(aItem);
     uint32_t indexInNewArray;
     nsresult rv = mFoldersWithNewMail->IndexOf(0, weakFolder, &indexInNewArray);
     bool folderFound = NS_SUCCEEDED(rv);
 
     if (aNewValue == nsIMsgFolder::nsMsgBiffState_NewMail)
     {
@@ -701,17 +700,17 @@ nsMessengerUnixIntegration::OnItemIntPro
     }
     else if (aNewValue == nsIMsgFolder::nsMsgBiffState_NoMail)
     {
       if (folderFound) {
         mFoldersWithNewMail->RemoveElementAt(indexInNewArray);
       }
     }
   } // if the biff property changed
-  else if (mNewMailReceivedAtom == aProperty)
+  else if (aProperty.Equals(kNewMailReceived))
   {
     FillToolTipInfo();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/mailnews/base/src/nsMessengerUnixIntegration.h
+++ b/mailnews/base/src/nsMessengerUnixIntegration.h
@@ -7,17 +7,16 @@
 #define __nsMessengerUnixIntegration_h
 
 #include "nsIMessengerOSIntegration.h"
 #include "nsIFolderListener.h"
 #include "nsIUrlListener.h"
 #include "nsIMutableArray.h"
 #include "nsIStringBundle.h"
 #include "nsIObserver.h"
-#include "nsIAtom.h"
 #include "nsDataHashtable.h"
 #include "nsTArray.h"
 
 #define NS_MESSENGERUNIXINTEGRATION_CID \
   {0xf62f3d3a, 0x1dd1, 0x11b2, \
     {0xa5, 0x16, 0xef, 0xad, 0xb1, 0x31, 0x61, 0x5c}}
 
 class nsIStringBundle;
@@ -48,16 +47,14 @@ private:
   nsresult GetMRUTimestampForFolder(nsIMsgFolder *aFolder, uint32_t *aLastMRUTime);
 
   bool BuildNotificationBody(nsIMsgDBHdr *aHdr, nsIStringBundle *Bundle, nsString &aBody);
   bool BuildNotificationTitle(nsIMsgFolder *aFolder, nsIStringBundle *aBundle, nsString &aTitle);
   nsresult ShowNewAlertNotification(bool aUserInitiated);
   nsresult PutMRUTimestampForFolder(nsIMsgFolder *aFolder, uint32_t aLastMRUTime);
 
   nsCOMPtr<nsIMutableArray> mFoldersWithNewMail;  // keep track of all the root folders with pending new mail
-  nsCOMPtr<nsIAtom> mBiffStateAtom;
-  nsCOMPtr<nsIAtom> mNewMailReceivedAtom;
   bool mAlertInProgress;
   nsDataHashtable<nsCStringHashKey, uint32_t> mLastMRUTimes; // We keep track of the last time we did a new mail notification for each account
   nsTArray<nsCString> mFetchingURIs;
 };
 
 #endif // __nsMessengerUnixIntegration_h
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -8,16 +8,17 @@
 
 #include "nsMessengerWinIntegration.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgMailSession.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsIMsgIdentity.h"
 #include "nsIMsgAccount.h"
 #include "nsIMsgFolder.h"
+#include "nsMsgDBFolder.h"
 #include "nsIMsgWindow.h"
 #include "nsCOMPtr.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgFolderFlags.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIDirectoryService.h"
 #include "nsIWindowWatcher.h"
@@ -234,22 +235,18 @@ static nsresult Create()
                                               0 ),        // create struct
                   NS_ERROR_FAILURE );
   return NS_OK;
 }
 
 
 nsMessengerWinIntegration::nsMessengerWinIntegration()
 {
-  mDefaultServerAtom = MsgGetAtom("DefaultServer");
-  mTotalUnreadMessagesAtom = MsgGetAtom("TotalUnreadMessages");
-
   mUnreadTimerActive = false;
 
-  mBiffStateAtom = MsgGetAtom("BiffState");
   mBiffIconVisible = false;
   mSuppressBiffIcon = false;
   mAlertInProgress = false;
   mBiffIconInitialized = false;
   mFoldersWithNewMail = do_CreateInstance(NS_ARRAY_CONTRACTID);
 }
 
 nsMessengerWinIntegration::~nsMessengerWinIntegration()
@@ -362,23 +359,23 @@ nsMessengerWinIntegration::Init()
 
   rv = ResetCurrent();
   NS_ENSURE_SUCCESS(rv,rv);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerWinIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
+nsMessengerWinIntegration::OnItemPropertyChanged(nsIMsgFolder *, const nsACString &, char const *, char const *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerWinIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
+nsMessengerWinIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, const nsACString &, const char16_t *, const char16_t *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerWinIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
@@ -790,34 +787,34 @@ void nsMessengerWinIntegration::DestroyB
 }
 
 void nsMessengerWinIntegration::GenericShellNotify(DWORD aMessage)
 {
   ::Shell_NotifyIconW( aMessage, &sBiffIconData );
 }
 
 NS_IMETHODIMP
-nsMessengerWinIntegration::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+nsMessengerWinIntegration::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerWinIntegration::OnItemAdded(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerWinIntegration::OnItemBoolPropertyChanged(nsIMsgFolder *aItem,
-                                                         nsIAtom *aProperty,
+                                                         const nsACString &aProperty,
                                                          bool aOldValue,
                                                          bool aNewValue)
 {
-  if (aProperty == mDefaultServerAtom) {
+  if (aProperty.Equals(kDefaultServer)) {
     nsresult rv;
 
     // this property changes multiple times
     // on account deletion or when the user changes their
     // default account.  ResetCurrent() will set
     // mInboxURI to null, so we use that
     // to prevent us from attempting to remove
     // something from the registry that has already been removed
@@ -832,26 +829,26 @@ nsMessengerWinIntegration::OnItemBoolPro
 
     rv = UpdateUnreadCount();
     NS_ENSURE_SUCCESS(rv,rv);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerWinIntegration::OnItemEvent(nsIMsgFolder *, nsIAtom *)
+nsMessengerWinIntegration::OnItemEvent(nsIMsgFolder *, const nsACString &)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMessengerWinIntegration::OnItemIntPropertyChanged(nsIMsgFolder *aItem, nsIAtom *aProperty, int64_t aOldValue, int64_t aNewValue)
+nsMessengerWinIntegration::OnItemIntPropertyChanged(nsIMsgFolder *aItem, const nsACString &aProperty, int64_t aOldValue, int64_t aNewValue)
 {
   // if we got new mail show a icon in the system tray
-  if (mBiffStateAtom == aProperty && mFoldersWithNewMail)
+  if (aProperty.Equals(kBiffState) && mFoldersWithNewMail)
   {
     nsCOMPtr<nsIWeakReference> weakFolder = do_GetWeakReference(aItem);
     uint32_t indexInNewArray;
     nsresult rv = mFoldersWithNewMail->IndexOf(0, weakFolder, &indexInNewArray);
     bool folderFound = NS_SUCCEEDED(rv);
 
     if (!mBiffIconInitialized)
       InitializeBiffStatusIcon();
@@ -891,17 +888,17 @@ nsMessengerWinIntegration::OnItemIntProp
       if (mBiffIconVisible)
       {
         mBiffIconVisible = false;
         GenericShellNotify(NIM_DELETE);
       }
     }
   } // if the biff property changed
 
-  if (aProperty == mTotalUnreadMessagesAtom) {
+  if (aProperty.Equals(kTotalUnreadMessages)) {
     nsCString itemURI;
     nsresult rv;
     rv = aItem->GetURI(itemURI);
     NS_ENSURE_SUCCESS(rv,rv);
 
     if (mInboxURI.Equals(itemURI))
       mCurrentUnreadCount = aNewValue;
 
--- a/mailnews/base/src/nsMessengerWinIntegration.h
+++ b/mailnews/base/src/nsMessengerWinIntegration.h
@@ -8,17 +8,16 @@
 
 #include <windows.h>
 
 // shellapi.h is needed to build with WIN32_LEAN_AND_MEAN
 #include <shellapi.h>
 
 #include "nsIMessengerOSIntegration.h"
 #include "nsIFolderListener.h"
-#include "nsIAtom.h"
 #include "nsITimer.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIMutableArray.h"
 #include "nsIObserver.h"
 
 #define NS_MESSENGERWININTEGRATION_CID \
   {0xf62f3d3a, 0x1dd1, 0x11b2, \
@@ -56,17 +55,16 @@ private:
   void FillToolTipInfo();
   void GenericShellNotify(DWORD aMessage);
   void DestroyBiffIcon();
 
   nsresult GetFirstFolderWithNewMail(nsACString& aFolderURI);
 
   nsresult GetStringBundle(nsIStringBundle **aBundle);
   nsCOMPtr<nsIMutableArray> mFoldersWithNewMail;  // keep track of all the root folders with pending new mail
-  nsCOMPtr<nsIAtom> mBiffStateAtom;
   uint32_t mCurrentBiffState;
 
   bool mBiffIconVisible;
   bool mBiffIconInitialized;
   bool mSuppressBiffIcon;
   bool mAlertInProgress;
   
   // "might" because we don't know until we check 
@@ -80,18 +78,16 @@ private:
   nsresult RemoveCurrentFromRegistry();
   nsresult UpdateRegistryWithCurrent();
   nsresult SetupInbox();
 
   nsresult SetupUnreadCountUpdateTimer();
   static void OnUnreadCountUpdateTimer(nsITimer *timer, void *osIntegration);
   nsresult UpdateUnreadCount();
 
-  nsCOMPtr <nsIAtom> mDefaultServerAtom;
-  nsCOMPtr <nsIAtom> mTotalUnreadMessagesAtom;
   nsCOMPtr <nsITimer> mUnreadCountUpdateTimer;
 
   nsCString mInboxURI;
   nsCString mEmail;
 
   nsString  mAppName;
   nsString  mEmailPrefix;
 
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -21,16 +21,17 @@
 #include "prthread.h"
 #include "plstr.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nscore.h"
 #include "prprf.h"
 #include "nsIMsgFolderCache.h"
 #include "nsMsgUtils.h"
+#include "nsMsgDBFolder.h"
 #include "nsIFile.h"
 #include "nsIURL.h"
 #include "nsNetCID.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsISmtpService.h"
 #include "nsIMsgBiffManager.h"
 #include "nsIMsgPurgeService.h"
@@ -818,28 +819,28 @@ nsMsgAccountManager::notifyDefaultServer
   nsCOMPtr<nsIMsgFolder> rootFolder;
 
   // first tell old server it's no longer the default
   if (aOldAccount) {
     rv = aOldAccount->GetIncomingServer(getter_AddRefs(server));
     if (NS_SUCCEEDED(rv) && server) {
       rv = server->GetRootFolder(getter_AddRefs(rootFolder));
       if (NS_SUCCEEDED(rv) && rootFolder)
-        rootFolder->NotifyBoolPropertyChanged(kDefaultServerAtom,
+        rootFolder->NotifyBoolPropertyChanged(kDefaultServer,
                                               true, false);
     }
   }
 
     // now tell new server it is.
   if (aNewAccount) {
     rv = aNewAccount->GetIncomingServer(getter_AddRefs(server));
     if (NS_SUCCEEDED(rv) && server) {
       rv = server->GetRootFolder(getter_AddRefs(rootFolder));
       if (NS_SUCCEEDED(rv) && rootFolder)
-        rootFolder->NotifyBoolPropertyChanged(kDefaultServerAtom,
+        rootFolder->NotifyBoolPropertyChanged(kDefaultServer,
                                               false, true);
     }
   }
 
   if (aOldAccount && aNewAccount)  //only notify if the user goes and changes default account
   {
     nsCOMPtr<nsIObserverService> observerService =
       mozilla::services::GetObserverService();
@@ -1038,19 +1039,16 @@ nsMsgAccountManager::LoadAccounts()
     mailSession->AddFolderListener(this, nsIFolderListener::added |
                                          nsIFolderListener::removed |
                                          nsIFolderListener::intPropertyChanged);
   // If we have code trying to do things after we've unloaded accounts,
   // ignore it.
   if (m_shutdownInProgress || m_haveShutdown)
     return NS_ERROR_FAILURE;
 
-  kDefaultServerAtom = MsgGetAtom("DefaultServer");
-  mFolderFlagAtom = MsgGetAtom("FolderFlag");
-
   //Ensure biff service has started
   nsCOMPtr<nsIMsgBiffManager> biffService =
            do_GetService(NS_MSGBIFFMANAGER_CONTRACTID, &rv);
 
   if (NS_SUCCEEDED(rv))
     biffService->Init();
 
   //Ensure purge service has started
@@ -1502,19 +1500,16 @@ nsMsgAccountManager::SetSpecialFolders()
   // set the JUNK folder flag on the spam folders, right?
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::UnloadAccounts()
 {
   // release the default account
-  kDefaultServerAtom = nullptr;
-  mFolderFlagAtom = nullptr;
-
   m_defaultAccount=nullptr;
   for (auto iter = m_incomingServers.Iter(); !iter.Done(); iter.Next()) {
     nsCOMPtr<nsIMsgIncomingServer>& server = iter.Data();
     if (!server)
       continue;
     nsresult rv;
     NotifyServerUnloaded(server);
 
@@ -3483,28 +3478,28 @@ NS_IMETHODIMP nsMsgAccountManager::OnIte
         }
       }
     }
   }
 
   return rv;
 }
 
-NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char *oldValue, const char *newValue)
+NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char *oldValue, const char *newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::OnItemIntPropertyChanged(nsIMsgFolder *aFolder,
-                                              nsIAtom *aProperty,
+                                              const nsACString &aProperty,
                                               int64_t oldValue,
                                               int64_t newValue)
 {
-  if (aProperty == mFolderFlagAtom)
+  if (aProperty.Equals(kFolderFlag))
   {
     uint32_t smartFlagsChanged = (oldValue ^ newValue) &
       (nsMsgFolderFlags::SpecialUse & ~nsMsgFolderFlags::Queue);
     if (smartFlagsChanged)
     {
       if (smartFlagsChanged & newValue)
       {
         // if the smart folder flag was set, calling OnItemAdded will
@@ -3588,33 +3583,33 @@ nsMsgAccountManager::RemoveFolderFromSma
           dbFolderInfo->SetCharProperty(kSearchFolderUriProp, searchURI);
         }
       }
     }
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP nsMsgAccountManager::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
+NS_IMETHODIMP nsMsgAccountManager::OnItemBoolPropertyChanged(nsIMsgFolder *item, const nsACString &property, bool oldValue, bool newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP nsMsgAccountManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
+NS_IMETHODIMP nsMsgAccountManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue, const char16_t *newValue)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
-NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP nsMsgAccountManager::OnItemEvent(nsIMsgFolder *aFolder, nsIAtom *aEvent)
+NS_IMETHODIMP nsMsgAccountManager::OnItemEvent(nsIMsgFolder *aFolder, const nsACString &aEvent)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::FolderUriForPath(nsIFile *aLocalPath,
                                                nsACString &aMailboxUri)
 {
--- a/mailnews/base/src/nsMsgAccountManager.h
+++ b/mailnews/base/src/nsMsgAccountManager.h
@@ -85,18 +85,16 @@ public:
   nsresult Shutdown();
   void LogoutOfServer(nsIMsgIncomingServer *aServer);
 
 private:
   virtual ~nsMsgAccountManager();
 
   bool m_accountsLoaded;
   nsCOMPtr <nsIMsgFolderCache> m_msgFolderCache;
-  nsCOMPtr<nsIAtom> kDefaultServerAtom;
-  nsCOMPtr<nsIAtom> mFolderFlagAtom;
   nsTArray<nsCOMPtr<nsIMsgAccount> > m_accounts;
   nsInterfaceHashtable<nsCStringHashKey, nsIMsgIdentity> m_identities;
   nsInterfaceHashtable<nsCStringHashKey, nsIMsgIncomingServer> m_incomingServers;
   nsCOMPtr<nsIMsgAccount> m_defaultAccount;
   nsCOMArray<nsIIncomingServerListener> m_incomingServerListeners;
   nsTObserverArray<RefPtr<VirtualFolderChangeListener> > m_virtualFolderListeners;
   nsCOMPtr<nsIMsgFolder> m_folderDoingEmptyTrash;
   nsCOMPtr<nsIMsgFolder> m_folderDoingCleanupInbox;
--- a/mailnews/base/src/nsMsgAccountManagerDS.cpp
+++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp
@@ -10,16 +10,17 @@
 #include "nsMsgAccountManagerDS.h"
 #include "rdf.h"
 #include "nsRDFCID.h"
 #include "nsIRDFDataSource.h"
 #include "nsEnumeratorUtils.h"
 #include "nsIServiceManager.h"
 #include "nsMsgRDFUtils.h"
 #include "nsIMsgFolder.h"
+#include "nsMsgDBFolder.h"
 #include "nsMsgBaseCID.h"
 
 #include "nsICategoryManager.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsArrayEnumerator.h"
@@ -78,18 +79,16 @@ nsIRDFResource* nsMsgAccountManagerDataS
 nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleDiskSpace=nullptr;
 nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleAddressing=nullptr;
 nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleSMTP=nullptr;
 nsIRDFResource* nsMsgAccountManagerDataSource::kNC_PageTitleJunk=nullptr;
 
 // common literals
 nsIRDFLiteral* nsMsgAccountManagerDataSource::kTrueLiteral = nullptr;
 
-nsIAtom* nsMsgAccountManagerDataSource::kDefaultServerAtom = nullptr;
-
 nsrefcnt nsMsgAccountManagerDataSource::gAccountManagerResourceRefCnt = 0;
 
 // shared arc lists
 nsCOMPtr<nsIMutableArray> nsMsgAccountManagerDataSource::mAccountArcsOut;
 nsCOMPtr<nsIMutableArray> nsMsgAccountManagerDataSource::mAccountRootArcsOut;
 
 
 // RDF to match
@@ -155,18 +154,16 @@ nsMsgAccountManagerDataSource::nsMsgAcco
                                  &kNC_AccountRoot);
 
     getRDFService()->GetLiteral(u"true",
                                 &kTrueLiteral);
 
     // eventually these need to exist in some kind of array
     // that's easily extensible
     getRDFService()->GetResource(NS_LITERAL_CSTRING(NC_RDF_SETTINGS), &kNC_Settings);
-
-    kDefaultServerAtom = MsgNewAtom("DefaultServer").take();
   }
 }
 
 nsMsgAccountManagerDataSource::~nsMsgAccountManagerDataSource()
 {
   nsCOMPtr<nsIMsgAccountManager> am = do_QueryReferent(mAccountManager);
   if (am)
     am->RemoveIncomingServerListener(this);
@@ -198,18 +195,16 @@ nsMsgAccountManagerDataSource::~nsMsgAcc
     NS_IF_RELEASE(kTrueLiteral);
 
     NS_IF_RELEASE(kNC_AccountRoot);
 
     // eventually these need to exist in some kind of array
     // that's easily extensible
     NS_IF_RELEASE(kNC_Settings);
 
-
-    NS_IF_RELEASE(kDefaultServerAtom);
     mAccountArcsOut = nullptr;
     mAccountRootArcsOut = nullptr;
   }
 
 }
 
 NS_IMPL_ADDREF_INHERITED(nsMsgAccountManagerDataSource, nsMsgRDFDataSource)
 NS_IMPL_RELEASE_INHERITED(nsMsgAccountManagerDataSource, nsMsgRDFDataSource)
@@ -1107,67 +1102,67 @@ nsMsgAccountManagerDataSource::OnServerU
 
 NS_IMETHODIMP
 nsMsgAccountManagerDataSource::OnServerChanged(nsIMsgIncomingServer *server)
 {
   return NS_OK;
 }
 
 nsresult
-nsMsgAccountManagerDataSource::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
+nsMsgAccountManagerDataSource::OnItemPropertyChanged(nsIMsgFolder *, const nsACString &, char const *, char const *)
 {
   return NS_OK;
 }
 
 nsresult
-nsMsgAccountManagerDataSource::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
+nsMsgAccountManagerDataSource::OnItemUnicharPropertyChanged(nsIMsgFolder *, const nsACString &, const char16_t *, const char16_t *)
 {
   return NS_OK;
 }
 
 nsresult
 nsMsgAccountManagerDataSource::OnItemRemoved(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
 }
 
 nsresult
-nsMsgAccountManagerDataSource::OnItemPropertyFlagChanged(nsIMsgDBHdr *, nsIAtom *, uint32_t, uint32_t)
+nsMsgAccountManagerDataSource::OnItemPropertyFlagChanged(nsIMsgDBHdr *, const nsACString &, uint32_t, uint32_t)
 {
   return NS_OK;
 }
 
 nsresult
 nsMsgAccountManagerDataSource::OnItemAdded(nsIMsgFolder *, nsISupports *)
 {
   return NS_OK;
 }
 
 
 nsresult
 nsMsgAccountManagerDataSource::OnItemBoolPropertyChanged(nsIMsgFolder *aItem,
-                                                         nsIAtom *aProperty,
+                                                         const nsACString &aProperty,
                                                          bool aOldValue,
                                                          bool aNewValue)
 {
-  if (aProperty == kDefaultServerAtom) {
+  if (aProperty.Equals(kDefaultServer)) {
     nsCOMPtr<nsIRDFResource> resource(do_QueryInterface(aItem));
     NotifyObservers(resource, kNC_IsDefaultServer, kTrueLiteral, nullptr, aNewValue, false);
   }
   return NS_OK;
 }
 
 nsresult
-nsMsgAccountManagerDataSource::OnItemEvent(nsIMsgFolder *, nsIAtom *)
+nsMsgAccountManagerDataSource::OnItemEvent(nsIMsgFolder *, const nsACString &)
 {
   return NS_OK;
 }
 
 nsresult
-nsMsgAccountManagerDataSource::OnItemIntPropertyChanged(nsIMsgFolder *, nsIAtom *, int64_t, int64_t)
+nsMsgAccountManagerDataSource::OnItemIntPropertyChanged(nsIMsgFolder *, const nsACString &, int64_t, int64_t)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManagerDataSource::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
 {
   nsMsgRDFDataSource::Observe(aSubject, aTopic, aData);
--- a/mailnews/base/src/nsMsgAccountManagerDS.h
+++ b/mailnews/base/src/nsMsgAccountManagerDS.h
@@ -117,18 +117,16 @@ protected:
   static nsIRDFResource* kNC_PageTitleSynchronization;
   static nsIRDFResource* kNC_PageTitleDiskSpace;
   static nsIRDFResource* kNC_PageTitleAddressing;
   static nsIRDFResource* kNC_PageTitleSMTP;
   static nsIRDFResource* kNC_PageTitleJunk;
 
   static nsIRDFLiteral* kTrueLiteral;
 
-  static nsIAtom* kDefaultServerAtom;
-
   static nsrefcnt gAccountManagerResourceRefCnt;
 
   static nsresult getAccountArcs(nsIMutableArray **aResult);
   static nsresult getAccountRootArcs(nsIMutableArray **aResult);
   
 private:
   nsresult serverHasIdentities(nsIMsgIncomingServer *aServer, bool *aResult);
   nsresult getStringBundle();
--- a/mailnews/base/src/nsMsgDBView.h
+++ b/mailnews/base/src/nsMsgDBView.h
@@ -122,19 +122,16 @@ protected:
   static nsrefcnt gInstanceCount;
 
   static char16_t* kHighestPriorityString;
   static char16_t* kHighPriorityString;
   static char16_t* kLowestPriorityString;
   static char16_t* kLowPriorityString;
   static char16_t* kNormalPriorityString;
 
-  static nsIAtom* kJunkMsgAtom;
-  static nsIAtom* kNotJunkMsgAtom;
-
   static char16_t* kReadString;
   static char16_t* kRepliedString;
   static char16_t* kForwardedString;
   static char16_t* kNewString;
 
   nsCOMPtr<nsITreeBoxObject> mTree;
   nsCOMPtr<nsITreeSelection> mTreeSelection;
   uint32_t mNumSelectedRows; // we cache this to determine when to push command status notifications.
--- a/mailnews/base/src/nsMsgFolderDataSource.cpp
+++ b/mailnews/base/src/nsMsgFolderDataSource.cpp
@@ -23,16 +23,17 @@
 
 #include "nsIMsgMailSession.h"
 #include "nsIMsgCopyService.h"
 #include "nsMsgBaseCID.h"
 #include "nsIInputStream.h"
 #include "nsIMsgHdr.h"
 #include "nsTraceRefcnt.h"
 #include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later...
+#include "nsMsgDBFolder.h"
 #include "nsIMutableArray.h"
 #include "nsIPop3IncomingServer.h"
 #include "nsINntpIncomingServer.h"
 #include "nsTextFormatter.h"
 #include "nsIStringBundle.h"
 #include "nsIPrompt.h"
 #include "nsIMsgAccountManager.h"
 #include "nsArrayEnumerator.h"
@@ -97,30 +98,16 @@ nsIRDFResource* nsMsgFolderDataSource::k
 nsIRDFResource* nsMsgFolderDataSource::kNC_MarkAllMessagesRead= nullptr;
 nsIRDFResource* nsMsgFolderDataSource::kNC_Compact= nullptr;
 nsIRDFResource* nsMsgFolderDataSource::kNC_CompactAll= nullptr;
 nsIRDFResource* nsMsgFolderDataSource::kNC_Rename= nullptr;
 nsIRDFResource* nsMsgFolderDataSource::kNC_EmptyTrash= nullptr;
 
 nsrefcnt nsMsgFolderDataSource::gFolderResourceRefCnt = 0;
 
-nsIAtom * nsMsgFolderDataSource::kBiffStateAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kSortOrderAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kNewMessagesAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kTotalMessagesAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kTotalUnreadMessagesAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kFolderSizeAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kNameAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kSynchronizeAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kOpenAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kIsDeferredAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kIsSecureAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kCanFileMessagesAtom = nullptr;
-nsIAtom * nsMsgFolderDataSource::kInVFEditSearchScopeAtom = nullptr;
-
 static const uint32_t kDisplayBlankCount = 0xFFFFFFFE;
 static const uint32_t kDisplayQuestionCount = 0xFFFFFFFF;
 static const int64_t kDisplayBlankCount64 = -2;
 static const int64_t kDisplayQuestionCount64 = -1;
 
 nsMsgFolderDataSource::nsMsgFolderDataSource()
 {
   // one-time initialization here
@@ -179,30 +166,16 @@ nsMsgFolderDataSource::nsMsgFolderDataSo
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COPYFOLDER), &kNC_CopyFolder);
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_MOVEFOLDER), &kNC_MoveFolder);
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_MARKALLMESSAGESREAD),
                              &kNC_MarkAllMessagesRead);
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COMPACT), &kNC_Compact);
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_COMPACTALL), &kNC_CompactAll);
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_RENAME), &kNC_Rename);
     rdf->GetResource(NS_LITERAL_CSTRING(NC_RDF_EMPTYTRASH), &kNC_EmptyTrash);
-
-    kTotalMessagesAtom           = MsgNewAtom("TotalMessages").take();
-    kTotalUnreadMessagesAtom     = MsgNewAtom("TotalUnreadMessages").take();
-    kFolderSizeAtom              = MsgNewAtom("FolderSize").take();
-    kBiffStateAtom               = MsgNewAtom("BiffState").take();
-    kSortOrderAtom               = MsgNewAtom("SortOrder").take();
-    kNewMessagesAtom             = MsgNewAtom("NewMessages").take();
-    kNameAtom                    = MsgNewAtom("Name").take();
-    kSynchronizeAtom             = MsgNewAtom("Synchronize").take();
-    kOpenAtom                    = MsgNewAtom("open").take();
-    kIsDeferredAtom              = MsgNewAtom("isDeferred").take();
-    kIsSecureAtom                = MsgNewAtom("isSecure").take();
-    kCanFileMessagesAtom         = MsgNewAtom("canFileMessages").take();
-    kInVFEditSearchScopeAtom     = MsgNewAtom("inVFEditSearchScope").take();
   }
 
   CreateLiterals(rdf);
   CreateArcsOutEnumerator();
 }
 
 nsMsgFolderDataSource::~nsMsgFolderDataSource (void)
 {
@@ -257,30 +230,16 @@ nsMsgFolderDataSource::~nsMsgFolderDataS
     NS_RELEASE2(kNC_MarkAllMessagesRead, refcnt);
     NS_RELEASE2(kNC_Compact, refcnt);
     NS_RELEASE2(kNC_CompactAll, refcnt);
     NS_RELEASE2(kNC_Rename, refcnt);
     NS_RELEASE2(kNC_EmptyTrash, refcnt);
     NS_RELEASE2(kNC_UnreadFolders, refcnt);
     NS_RELEASE2(kNC_FavoriteFolders, refcnt);
     NS_RELEASE2(kNC_RecentFolders, refcnt);
-
-    NS_RELEASE(kTotalMessagesAtom);
-    NS_RELEASE(kTotalUnreadMessagesAtom);
-    NS_RELEASE(kFolderSizeAtom);
-    NS_RELEASE(kBiffStateAtom);
-    NS_RELEASE(kSortOrderAtom);
-    NS_RELEASE(kNewMessagesAtom);
-    NS_RELEASE(kNameAtom);
-    NS_RELEASE(kSynchronizeAtom);
-    NS_RELEASE(kOpenAtom);
-    NS_RELEASE(kIsDeferredAtom);
-    NS_RELEASE(kIsSecureAtom);
-    NS_RELEASE(kCanFileMessagesAtom);
-    NS_RELEASE(kInVFEditSearchScopeAtom);
   }
 }
 
 nsresult nsMsgFolderDataSource::CreateLiterals(nsIRDFService *rdf)
 {
   createNode(u"true",
     getter_AddRefs(kTrueLiteral), rdf);
   createNode(u"false",
@@ -807,110 +766,110 @@ nsresult nsMsgFolderDataSource::OnItemAd
     if (parentResource) // RDF is not happy about a null parent resource.
       NotifyObservers(parentResource, kNC_Child, itemNode, nullptr, added, false);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgFolderDataSource::OnItemPropertyChanged(nsIMsgFolder *resource,
-                                             nsIAtom *property,
+                                             const nsACString &property,
                                              const char *oldValue,
                                              const char *newValue)
 
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgFolderDataSource::OnItemIntPropertyChanged(nsIMsgFolder *folder,
-                                                nsIAtom *property,
+                                                const nsACString &property,
                                                 int64_t oldValue,
                                                 int64_t newValue)
 {
   nsCOMPtr<nsIRDFResource> resource(do_QueryInterface(folder));
-  if (kTotalMessagesAtom == property)
+  if (property.Equals(kTotalMessages))
     OnTotalMessagePropertyChanged(resource, oldValue, newValue);
-  else if (kTotalUnreadMessagesAtom == property)
+  else if (property.Equals(kTotalUnreadMessages))
     OnUnreadMessagePropertyChanged(resource, oldValue, newValue);
-  else if (kFolderSizeAtom == property)
+  else if (property.Equals(kFolderSize))
     OnFolderSizePropertyChanged(resource, oldValue, newValue);
-  else if (kSortOrderAtom == property)
+  else if (property.Equals(kSortOrder))
     OnFolderSortOrderPropertyChanged(resource, oldValue, newValue);
-  else if (kBiffStateAtom == property) {
+  else if (property.Equals(kBiffState)) {
     // be careful about skipping if oldValue == newValue
     // see the comment in nsMsgFolder::SetBiffState() about filters
 
     nsCOMPtr<nsIRDFNode> biffNode;
     nsresult rv = createBiffStateNodeFromFlag(newValue, getter_AddRefs(biffNode));
     NS_ENSURE_SUCCESS(rv,rv);
 
     NotifyPropertyChanged(resource, kNC_BiffState, biffNode);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgFolderDataSource::OnItemUnicharPropertyChanged(nsIMsgFolder *folder,
-                                                    nsIAtom *property,
+                                                    const nsACString &property,
                                                     const char16_t *oldValue,
                                                     const char16_t *newValue)
 {
   nsCOMPtr<nsIRDFResource> resource(do_QueryInterface(folder));
-  if (kNameAtom == property)
+  if (property.Equals(kName))
   {
     int32_t numUnread;
     folder->GetNumUnread(false, &numUnread);
     NotifyFolderTreeNameChanged(folder, resource, numUnread);
     NotifyFolderTreeSimpleNameChanged(folder, resource);
     NotifyFolderNameChanged(folder, resource);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgFolderDataSource::OnItemBoolPropertyChanged(nsIMsgFolder *folder,
-                                                 nsIAtom *property,
+                                                 const nsACString &property,
                                                  bool oldValue,
                                                  bool newValue)
 {
   nsCOMPtr<nsIRDFResource> resource(do_QueryInterface(folder));
   if (newValue != oldValue) {
     nsIRDFNode* literalNode = newValue?kTrueLiteral:kFalseLiteral;
     nsIRDFNode* oldLiteralNode = oldValue?kTrueLiteral:kFalseLiteral;
-    if (kNewMessagesAtom == property)
+    if (property.Equals(kNewMessages))
       NotifyPropertyChanged(resource, kNC_NewMessages, literalNode);
-    else if (kSynchronizeAtom == property)
+    else if (property.Equals(kSynchronize))
       NotifyPropertyChanged(resource, kNC_Synchronize, literalNode);
-    else if (kOpenAtom == property)
+    else if (property.Equals(kOpen))
       NotifyPropertyChanged(resource, kNC_Open, literalNode);
-    else if (kIsDeferredAtom == property)
+    else if (property.Equals(kIsDeferred))
       NotifyPropertyChanged(resource, kNC_IsDeferred, literalNode, oldLiteralNode);
-    else if (kIsSecureAtom == property)
+    else if (property.Equals(kIsSecure))
       NotifyPropertyChanged(resource, kNC_IsSecure, literalNode, oldLiteralNode);
-    else if (kCanFileMessagesAtom == property)
+    else if (property.Equals(kCanFileMessages))
       NotifyPropertyChanged(resource, kNC_CanFileMessages, literalNode, oldLiteralNode);
-    else if (kInVFEditSearchScopeAtom == property)
+    else if (property.Equals(kInVFEditSearchScope))
       NotifyPropertyChanged(resource, kNC_InVFEditSearchScope, literalNode);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgFolderDataSource::OnItemPropertyFlagChanged(nsIMsgDBHdr *item,
-                                                 nsIAtom *property,
+                                                 const nsACString &property,
                                                  uint32_t oldFlag,
                                                  uint32_t newFlag)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgFolderDataSource::OnItemEvent(nsIMsgFolder *aFolder, nsIAtom *aEvent)
+nsMsgFolderDataSource::OnItemEvent(nsIMsgFolder *aFolder, const nsACString &aEvent)
 {
   return NS_OK;
 }
 
 
 nsresult nsMsgFolderDataSource::createFolderNode(nsIMsgFolder* folder,
                                                  nsIRDFResource* property,
                                                  nsIRDFNode** target)
--- a/mailnews/base/src/nsMsgFolderDataSource.h
+++ b/mailnews/base/src/nsMsgFolderDataSource.h
@@ -8,16 +8,18 @@
 #include "nsIRDFService.h"
 
 #include "nsIFolderListener.h"
 #include "nsMsgRDFDataSource.h"
 
 #include "nsITransactionManager.h"
 #include "nsCOMArray.h"
 #include "nsIMutableArray.h"
+#include "nsString.h"
+
 #if 0
 // Disable deprecation warnings generated by nsISupportsArray and associated
 // classes.
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #elif defined(_MSC_VER)
 #pragma warning (disable : 4996)
 #endif
@@ -255,32 +257,18 @@ protected:
   static nsIRDFResource* kNC_CompactAll;
   static nsIRDFResource* kNC_Rename;
   static nsIRDFResource* kNC_EmptyTrash;
   static nsIRDFResource* kNC_DownloadFlagged;
   //Cached literals
   nsCOMPtr<nsIRDFNode> kTrueLiteral;
   nsCOMPtr<nsIRDFNode> kFalseLiteral;
 
-  // property atoms
-  static nsIAtom* kTotalMessagesAtom;
-  static nsIAtom* kTotalUnreadMessagesAtom;
-  static nsIAtom* kFolderSizeAtom;
-  static nsIAtom* kBiffStateAtom;
-  static nsIAtom* kSortOrderAtom;
-  static nsIAtom* kNewMessagesAtom;
-  static nsIAtom* kNameAtom;
-  static nsIAtom* kSynchronizeAtom;
-  static nsIAtom* kOpenAtom;
-  static nsIAtom* kIsDeferredAtom;
-  static nsIAtom* kIsSecureAtom;
   static nsrefcnt gFolderResourceRefCnt;
-  static nsIAtom* kCanFileMessagesAtom;
-  static nsIAtom* kInVFEditSearchScopeAtom;
-  
+
   nsCOMArray<nsIRDFResource> kFolderArcsOutArray;
 
 };
 
 
 class nsMsgFlatFolderDataSource : public nsMsgFolderDataSource
 {
 public:
--- a/mailnews/base/src/nsMsgMailSession.cpp
+++ b/mailnews/base/src/nsMsgMailSession.cpp
@@ -91,61 +91,61 @@ NS_IMETHODIMP nsMsgMailSession::RemoveFo
     const folderListener &fL = iter.GetNext();                         \
     if (fL.mNotifyFlags & nsIFolderListener::propertyflag_)            \
       fL.mListener->propertyfunc_ params_;                             \
   }                                                                    \
   PR_END_MACRO
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemPropertyChanged(nsIMsgFolder *aItem,
-                                        nsIAtom *aProperty,
+                                        const nsACString &aProperty,
                                         const char* aOldValue,
                                         const char* aNewValue)
 {
   NOTIFY_FOLDER_LISTENERS(propertyChanged, OnItemPropertyChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemUnicharPropertyChanged(nsIMsgFolder *aItem,
-                                               nsIAtom *aProperty,
+                                               const nsACString &aProperty,
                                                const char16_t* aOldValue,
                                                const char16_t* aNewValue)
 {
   NOTIFY_FOLDER_LISTENERS(unicharPropertyChanged, OnItemUnicharPropertyChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemIntPropertyChanged(nsIMsgFolder *aItem,
-                                           nsIAtom *aProperty,
+                                           const nsACString &aProperty,
                                            int64_t aOldValue,
                                            int64_t aNewValue)
 {
   NOTIFY_FOLDER_LISTENERS(intPropertyChanged, OnItemIntPropertyChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemBoolPropertyChanged(nsIMsgFolder *aItem,
-                                            nsIAtom *aProperty,
+                                            const nsACString &aProperty,
                                             bool aOldValue,
                                             bool aNewValue)
 {
   NOTIFY_FOLDER_LISTENERS(boolPropertyChanged, OnItemBoolPropertyChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemPropertyFlagChanged(nsIMsgDBHdr *aItem,
-                                            nsIAtom *aProperty,
+                                            const nsACString &aProperty,
                                             uint32_t aOldValue,
                                             uint32_t aNewValue)
 {
   NOTIFY_FOLDER_LISTENERS(propertyFlagChanged, OnItemPropertyFlagChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
@@ -159,17 +159,17 @@ NS_IMETHODIMP nsMsgMailSession::OnItemAd
 NS_IMETHODIMP nsMsgMailSession::OnItemRemoved(nsIMsgFolder *aParentItem,
                                               nsISupports *aItem)
 {
   NOTIFY_FOLDER_LISTENERS(removed, OnItemRemoved, (aParentItem, aItem));
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgMailSession::OnItemEvent(nsIMsgFolder *aFolder,
-                                            nsIAtom *aEvent)
+                                            const nsACString &aEvent)
 {
   NOTIFY_FOLDER_LISTENERS(event, OnItemEvent, (aFolder, aEvent));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::AddUserFeedbackListener(nsIMsgUserFeedbackListener *aListener)
 {
--- a/mailnews/base/src/nsMsgStatusFeedback.cpp
+++ b/mailnews/base/src/nsMsgStatusFeedback.cpp
@@ -15,34 +15,33 @@
 #include "nsIChannel.h"
 #include "prinrval.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsIMimeMiscStatus.h"
 #include "nsIMsgWindow.h"
 #include "nsMsgUtils.h"
 #include "nsIMsgHdr.h"
 #include "nsIMsgFolder.h"
+#include "nsMsgDBFolder.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/Services.h"
 #include "nsMsgUtils.h"
 
 #define MSGFEEDBACK_TIMER_INTERVAL 500
 
 nsMsgStatusFeedback::nsMsgStatusFeedback() :
   m_lastPercent(0),
   m_lastProgressTime(0)
 {
   nsCOMPtr<nsIStringBundleService> bundleService =
     mozilla::services::GetStringBundleService();
 
   if (bundleService)
     bundleService->CreateBundle("chrome://messenger/locale/messenger.properties",
                                 getter_AddRefs(mBundle));
-
-  m_msgLoadedAtom = MsgGetAtom("msgLoaded");
 }
 
 nsMsgStatusFeedback::~nsMsgStatusFeedback()
 {
   mBundle = nullptr;
 }
 
 NS_IMPL_ISUPPORTS(nsMsgStatusFeedback, nsIMsgStatusFeedback,
@@ -128,17 +127,17 @@ nsMsgStatusFeedback::OnStateChange(nsIWe
             nsCOMPtr <nsIMsgFolder> msgFolder;
             mailnewsUrl->GetFolder(getter_AddRefs(msgFolder));
             nsCOMPtr <nsIMsgMessageUrl> msgUrl = do_QueryInterface(mailnewsUrl);
             if (msgUrl)
             {
               // not sending this notification is not a fatal error...
               (void) msgUrl->GetMessageHeader(getter_AddRefs(msgHdr));
               if (msgFolder && msgHdr)
-                msgFolder->NotifyPropertyFlagChanged(msgHdr, m_msgLoadedAtom, 0, 1);
+                msgFolder->NotifyPropertyFlagChanged(msgHdr, kMsgLoaded, 0, 1);
             }
           }
         }
       }
       StopMeteors();
       nsString documentDone;
       rv = mBundle->GetStringFromName("documentDone", documentDone);
       if (NS_SUCCEEDED(rv))
--- a/mailnews/base/src/nsMsgStatusFeedback.h
+++ b/mailnews/base/src/nsMsgStatusFeedback.h
@@ -9,17 +9,16 @@
 #include "nsIWebProgressListener.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
 #include "nsCOMPtr.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsIProgressEventSink.h"
 #include "nsIStringBundle.h"
 #include "nsWeakReference.h"
-#include "nsIAtom.h"
 
 class nsMsgStatusFeedback : public nsIMsgStatusFeedback,
                             public nsIProgressEventSink,
                             public nsIWebProgressListener,
                             public nsSupportsWeakReference
 {
 public:
   nsMsgStatusFeedback();
@@ -39,12 +38,11 @@ protected:
   void BeginObserving();
   void EndObserving();
 
   // the JS status feedback implementation object...eventually this object
   // will replace this very C++ class you are looking at.
   nsWeakPtr mJSStatusFeedbackWeak;
 
   nsCOMPtr<nsIStringBundle> mBundle;
-  nsCOMPtr <nsIAtom> m_msgLoadedAtom;
 };
 
 #endif // _nsMsgStatusFeedback_h
--- a/mailnews/base/src/nsMsgWindow.h
+++ b/mailnews/base/src/nsMsgWindow.h
@@ -5,22 +5,22 @@
 
 #ifndef _nsMsgWindow_h
 #define _nsMsgWindow_h
 
 #include "nsIMsgWindow.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsITransactionManager.h"
 #include "nsIMsgFolder.h"
+#include "nsCOMPtr.h"
 #include "nsIDocShell.h"
 #include "nsIURIContentListener.h"
 #include "nsIMimeMiscStatus.h"
 #include "nsWeakReference.h"
 #include "nsIInterfaceRequestor.h"
-#include "nsCOMPtr.h"
 
 class nsMsgWindow : public nsIMsgWindow,
                     public nsIURIContentListener,
                     public nsIMsgWindowTest,
                     public nsSupportsWeakReference
 {
 
 public:
--- a/mailnews/base/src/nsStatusBarBiffManager.cpp
+++ b/mailnews/base/src/nsStatusBarBiffManager.cpp
@@ -8,40 +8,38 @@
 #include "nsIMsgMailSession.h"
 #include "nsIMsgAccountManager.h"
 #include "nsMsgBaseCID.h"
 #include "nsIObserverService.h"
 #include "nsIWindowMediator.h"
 #include "nsIMsgMailSession.h"
 #include "MailNewsTypes.h"
 #include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later...
+#include "nsMsgDBFolder.h"
 #include "nsIFileChannel.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIURL.h"
 #include "nsNetUtil.h"
 #include "nsIFileURL.h"
 #include "nsIFile.h"
 #include "nsMsgUtils.h"
 #include "mozilla/Services.h"
 
 // QueryInterface, AddRef, and Release
 //
 NS_IMPL_ISUPPORTS(nsStatusBarBiffManager, nsIStatusBarBiffManager, nsIFolderListener, nsIObserver)
 
-nsIAtom * nsStatusBarBiffManager::kBiffStateAtom = nullptr;
-
 nsStatusBarBiffManager::nsStatusBarBiffManager()
 : mInitialized(false), mCurrentBiffState(nsIMsgFolder::nsMsgBiffState_Unknown)
 {
 }
 
 nsStatusBarBiffManager::~nsStatusBarBiffManager()
 {
-    NS_IF_RELEASE(kBiffStateAtom);
 }
 
 #define NEW_MAIL_PREF_BRANCH             "mail.biff."
 #define CHAT_PREF_BRANCH                 "mail.chat."
 #define FEED_PREF_BRANCH                 "mail.feed."
 #define PREF_PLAY_SOUND                  "play_sound"
 #define PREF_SOUND_URL                   "play_sound.url"
 #define PREF_SOUND_TYPE                  "play_sound.type"
@@ -52,18 +50,16 @@ nsStatusBarBiffManager::~nsStatusBarBiff
 
 nsresult nsStatusBarBiffManager::Init()
 {
   if (mInitialized)
     return NS_ERROR_ALREADY_INITIALIZED;
 
   nsresult rv;
 
-  kBiffStateAtom = MsgNewAtom("BiffState").take();
-
   nsCOMPtr<nsIMsgMailSession> mailSession = 
     do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv); 
   if(NS_SUCCEEDED(rv))
     mailSession->AddFolderListener(this, nsIFolderListener::intPropertyChanged);
 
   nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -168,25 +164,25 @@ nsStatusBarBiffManager::OnItemAdded(nsIM
 
 NS_IMETHODIMP 
 nsStatusBarBiffManager::OnItemRemoved(nsIMsgFolder *parentItem, nsISupports *item)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsStatusBarBiffManager::OnItemPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char *oldValue, const char *newValue)
+nsStatusBarBiffManager::OnItemPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char *oldValue, const char *newValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStatusBarBiffManager::OnItemIntPropertyChanged(nsIMsgFolder *item, nsIAtom *property, int64_t oldValue, int64_t newValue)
+nsStatusBarBiffManager::OnItemIntPropertyChanged(nsIMsgFolder *item, const nsACString &property, int64_t oldValue, int64_t newValue)
 {
-  if (kBiffStateAtom == property && mCurrentBiffState != newValue) {
+  if (property.Equals(kBiffState) && mCurrentBiffState != newValue) {
     // if we got new mail, attempt to play a sound.
     // if we fail along the way, don't return.
     // we still need to update the UI.    
     if (newValue == nsIMsgFolder::nsMsgBiffState_NewMail) {
       // Get the folder's server type.
       nsCOMPtr<nsIMsgIncomingServer> server;
       nsresult rv = item->GetServer(getter_AddRefs(server));
       if (NS_SUCCEEDED(rv) && server)
@@ -203,35 +199,35 @@ nsStatusBarBiffManager::OnItemIntPropert
       
     if (observerService)
       observerService->NotifyObservers(static_cast<nsIStatusBarBiffManager*>(this), "mail:biff-state-changed", nullptr);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsStatusBarBiffManager::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
+nsStatusBarBiffManager::OnItemBoolPropertyChanged(nsIMsgFolder *item, const nsACString &property, bool oldValue, bool newValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsStatusBarBiffManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
+nsStatusBarBiffManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue, const char16_t *newValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsStatusBarBiffManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+nsStatusBarBiffManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsStatusBarBiffManager::OnItemEvent(nsIMsgFolder *item, nsIAtom *event)
+nsStatusBarBiffManager::OnItemEvent(nsIMsgFolder *item, const nsACString &event)
 {
   return NS_OK;
 }
 
 // nsIObserver implementation
 NS_IMETHODIMP
 nsStatusBarBiffManager::Observe(nsISupports *aSubject,
                                 const char *aTopic,
--- a/mailnews/base/src/nsStatusBarBiffManager.h
+++ b/mailnews/base/src/nsStatusBarBiffManager.h
@@ -28,17 +28,14 @@ public:
 private:
   virtual ~nsStatusBarBiffManager();
 
   bool     mInitialized;
   int32_t  mCurrentBiffState;
   nsCString mServerType;
   nsCOMPtr<nsISound> mSound;
   nsresult PlayBiffSound(const char *aPrefBranch);
-
-protected:
-  static nsIAtom* kBiffStateAtom;
 };
 
 
 
 #endif // nsStatusBarBiffManager_h__
 
--- a/mailnews/base/util/moz.build
+++ b/mailnews/base/util/moz.build
@@ -3,17 +3,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS += [
     'nsImapMoveCoalescer.h',
     'nsMsgCompressIStream.h',
     'nsMsgCompressOStream.h',
     'nsMsgDBFolder.h',
-    'nsMsgDBFolderAtomList.h',
     'nsMsgI18N.h',
     'nsMsgIdentity.h',
     'nsMsgIncomingServer.h',
     'nsMsgKeyArray.h',
     'nsMsgKeySet.h',
     'nsMsgLineBuffer.h',
     'nsMsgMailNewsUrl.h',
     'nsMsgProtocol.h',
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -95,26 +95,59 @@ nsString nsMsgDBFolder::kLocalizedTempla
 nsString nsMsgDBFolder::kLocalizedUnsentName;
 nsString nsMsgDBFolder::kLocalizedJunkName;
 nsString nsMsgDBFolder::kLocalizedArchivesName;
 
 nsString nsMsgDBFolder::kLocalizedBrandShortName;
 
 nsrefcnt nsMsgDBFolder::mInstanceCount=0;
 
-NS_IMPL_ISUPPORTS_INHERITED(nsMsgDBFolder, nsRDFResource, 
+// We define strings for folder properties and events.
+// Properties:
+NS_NAMED_LITERAL_CSTRING(kBiffState, "BiffState");
+NS_NAMED_LITERAL_CSTRING(kCanFileMessages, "CanFileMessages");
+NS_NAMED_LITERAL_CSTRING(kDefaultServer, "DefaultServer");
+NS_NAMED_LITERAL_CSTRING(kFlagged, "Flagged");
+NS_NAMED_LITERAL_CSTRING(kFolderFlag, "FolderFlag");
+NS_NAMED_LITERAL_CSTRING(kFolderSize, "FolderSize");
+NS_NAMED_LITERAL_CSTRING(kInVFEditSearchScope, "inVFEditSearchScope");
+NS_NAMED_LITERAL_CSTRING(kIsDeferred, "isDeferred");
+NS_NAMED_LITERAL_CSTRING(kIsSecure, "isSecure");
+NS_NAMED_LITERAL_CSTRING(kJunkStatusChanged, "JunkStatusChanged");
+NS_NAMED_LITERAL_CSTRING(kKeywords, "Keywords");
+NS_NAMED_LITERAL_CSTRING(kMRMTimeChanged, "MRMTimeChanged");
+NS_NAMED_LITERAL_CSTRING(kMsgLoaded, "msgLoaded");
+NS_NAMED_LITERAL_CSTRING(kName, "Name");
+NS_NAMED_LITERAL_CSTRING(kNewMailReceived, "NewMailReceived");
+NS_NAMED_LITERAL_CSTRING(kNewMessages, "NewMessages");
+NS_NAMED_LITERAL_CSTRING(kOpen, "open");
+NS_NAMED_LITERAL_CSTRING(kSortOrder, "SortOrder");
+NS_NAMED_LITERAL_CSTRING(kStatus, "Status");
+NS_NAMED_LITERAL_CSTRING(kSynchronize, "Synchronize");
+NS_NAMED_LITERAL_CSTRING(kTotalMessages, "TotalMessages");
+NS_NAMED_LITERAL_CSTRING(kTotalUnreadMessages, "TotalUnreadMessages");
+
+// Events:
+NS_NAMED_LITERAL_CSTRING(kAboutToCompact, "AboutToCompact");
+NS_NAMED_LITERAL_CSTRING(kCompactCompleted, "CompactCompleted");
+NS_NAMED_LITERAL_CSTRING(kDeleteOrMoveMsgCompleted, "DeleteOrMoveMsgCompleted");
+NS_NAMED_LITERAL_CSTRING(kDeleteOrMoveMsgFailed, "DeleteOrMoveMsgFailed");
+NS_NAMED_LITERAL_CSTRING(kFiltersApplied, "FiltersApplied");
+NS_NAMED_LITERAL_CSTRING(kFolderCreateCompleted, "FolderCreateCompleted");
+NS_NAMED_LITERAL_CSTRING(kFolderCreateFailed, "FolderCreateFailed");
+NS_NAMED_LITERAL_CSTRING(kFolderLoaded, "FolderLoaded");
+NS_NAMED_LITERAL_CSTRING(kNumNewBiffMessages, "NumNewBiffMessages");
+NS_NAMED_LITERAL_CSTRING(kRenameCompleted, "RenameCompleted");
+
+NS_IMPL_ISUPPORTS_INHERITED(nsMsgDBFolder, nsRDFResource,
                              nsISupportsWeakReference, nsIMsgFolder,
                              nsIDBChangeListener, nsIUrlListener,
                              nsIJunkMailClassificationListener,
                              nsIMsgTraitClassificationListener)
 
-#define MSGDBFOLDER_ATOM(name_, value_) nsIAtom* nsMsgDBFolder::name_ = nullptr;
-#include "nsMsgDBFolderAtomList.h"
-#undef MSGDBFOLDER_ATOM
-
 nsMsgDBFolder::nsMsgDBFolder(void)
 : mAddListener(true),
   mNewMessages(false),
   mGettingNewMessages(false),
   mLastMessageLoaded(nsMsgKey_None),
   mFlags(0),
   mNumUnreadMessages(-1),
   mNumTotalMessages(-1),
@@ -127,19 +160,16 @@ nsMsgDBFolder::nsMsgDBFolder(void)
   mFolderSize(kSizeUnknown),
   mNumNewBiffMessages(0),
   mHaveParsedURI(false),
   mIsServerIsValid(false),
   mIsServer(false),
   mInVFEditSearchScope (false)
 {
   if (mInstanceCount++ <=0) {
-#define MSGDBFOLDER_ATOM(name_, value_) name_ = MsgNewAtom(value_).take();
-#include "nsMsgDBFolderAtomList.h"
-#undef MSGDBFOLDER_ATOM
     initializeStrings();
     createCollationKeyGenerator();
     gtimeOfLastPurgeCheck = 0;
   }
 
   mProcessingFlag[0].bit = nsMsgProcessingFlags::ClassifyJunk;
   mProcessingFlag[1].bit = nsMsgProcessingFlags::ClassifyTraits;
   mProcessingFlag[2].bit = nsMsgProcessingFlags::TraitsDone;
@@ -152,20 +182,16 @@ nsMsgDBFolder::nsMsgDBFolder(void)
 
 nsMsgDBFolder::~nsMsgDBFolder(void)
 {
   for (uint32_t i = 0; i < nsMsgProcessingFlags::NumberOfFlags; i++)
     delete mProcessingFlag[i].keys;
 
   if (--mInstanceCount == 0) {
     NS_IF_RELEASE(gCollationKeyGenerator);
-
-#define MSGDBFOLDER_ATOM(name_, value_) NS_RELEASE(name_);
-#include "nsMsgDBFolderAtomList.h"
-#undef MSGDBFOLDER_ATOM
   }
   //shutdown but don't shutdown children.
   Shutdown(false);
 }
 
 NS_IMETHODIMP nsMsgDBFolder::Shutdown(bool shutdownChildren)
 {
   if(mDatabase)
@@ -455,17 +481,17 @@ NS_IMETHODIMP nsMsgDBFolder::SetHasNewMe
     // Only change mru time if we're going from doesn't have new to has new.
     // technically, we should probably update mru time for every new message
     // but we would pay a performance penalty for that. If the user
     // opens the folder, the mrutime will get updated anyway.
     if (curNewMessages)
       SetMRUTime();
     bool oldNewMessages = mNewMessages;
     mNewMessages = curNewMessages;
-    NotifyBoolPropertyChanged(kNewMessagesAtom, oldNewMessages, curNewMessages);
+    NotifyBoolPropertyChanged(kNewMessages, oldNewMessages, curNewMessages);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::GetHasFolderOrSubfolderNewMessages(bool *aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
@@ -684,24 +710,24 @@ nsresult nsMsgDBFolder::ReadDBFolderInfo
 
 nsresult nsMsgDBFolder::SendFlagNotifications(nsIMsgDBHdr *item, uint32_t oldFlags, uint32_t newFlags)
 {
   nsresult rv = NS_OK;
   uint32_t changedFlags = oldFlags ^ newFlags;
   if((changedFlags & nsMsgMessageFlags::Read)  && (changedFlags & nsMsgMessageFlags::New))
   {
     //..so..if the msg is read in the folder and the folder has new msgs clear the account level and status bar biffs.
-    rv = NotifyPropertyFlagChanged(item, kStatusAtom, oldFlags, newFlags);
+    rv = NotifyPropertyFlagChanged(item, kStatus, oldFlags, newFlags);
     rv = SetBiffState(nsMsgBiffState_NoMail);
   }
   else if(changedFlags & (nsMsgMessageFlags::Read | nsMsgMessageFlags::Replied | nsMsgMessageFlags::Forwarded
     | nsMsgMessageFlags::IMAPDeleted | nsMsgMessageFlags::New | nsMsgMessageFlags::Offline))
-    rv = NotifyPropertyFlagChanged(item, kStatusAtom, oldFlags, newFlags);
+    rv = NotifyPropertyFlagChanged(item, kStatus, oldFlags, newFlags);
   else if((changedFlags & nsMsgMessageFlags::Marked))
-    rv = NotifyPropertyFlagChanged(item, kFlaggedAtom, oldFlags, newFlags);
+    rv = NotifyPropertyFlagChanged(item, kFlagged, oldFlags, newFlags);
   return rv;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::DownloadMessagesForOffline(nsIArray *messages, nsIMsgWindow *)
 {
   NS_ASSERTION(false, "imap and news need to override this");
   return NS_OK;
 }
@@ -978,17 +1004,17 @@ nsMsgDBFolder::OnReadChanged(nsIDBChange
 {
   /* do nothing.  if you care about this, override it.  see nsNewsFolder.cpp */
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::OnJunkScoreChanged(nsIDBChangeListener * aInstigator)
 {
-  NotifyFolderEvent(mJunkStatusChangedAtom);
+  NotifyFolderEvent(kJunkStatusChanged);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::OnHdrPropertyChanged(nsIMsgDBHdr *aHdrToChange, bool aPreChange, uint32_t *aStatus, 
                                    nsIDBChangeListener *aInstigator)
 {
   /* do nothing.  if you care about this, override it.*/
@@ -1497,17 +1523,17 @@ NS_IMETHODIMP
 nsMsgDBFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
 {
   NS_ENSURE_ARG_POINTER(aUrl);
   nsCOMPtr<nsIMsgMailNewsUrl> mailUrl = do_QueryInterface(aUrl);
   if (mailUrl)
   {
     bool updatingFolder = false;
     if (NS_SUCCEEDED(mailUrl->GetUpdatingFolder(&updatingFolder)) && updatingFolder)
-      NotifyFolderEvent(mFolderLoadedAtom);
+      NotifyFolderEvent(kFolderLoaded);
 
     // be sure to remove ourselves as a url listener
     mailUrl->UnRegisterListener(this);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -1944,18 +1970,17 @@ nsresult nsMsgDBFolder::HandleAutoCompac
               branch->SetBoolPref(PREF_MAIL_PURGE_ASK, false);
           }
         }
         else
           okToCompact = aWindow || !askBeforePurge;
 
         if (okToCompact)
         {
-          nsCOMPtr <nsIAtom> aboutToCompactAtom = MsgGetAtom("AboutToCompact");
-          NotifyFolderEvent(aboutToCompactAtom);
+          NotifyFolderEvent(kAboutToCompact);
 
          if (localExpungedBytes > 0)
          {
             nsCOMPtr<nsIMsgFolderCompactor> folderCompactor =
               do_CreateInstance(NS_MSGLOCALFOLDERCOMPACTOR_CONTRACTID, &rv);
             NS_ENSURE_SUCCESS(rv, rv);
 
             if (offlineExpungedBytes > 0)
@@ -3430,17 +3455,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetName(nsA
 
 NS_IMETHODIMP nsMsgDBFolder::SetName(const nsAString& name)
 {
   // override the URI-generated name
   if (!mName.Equals(name))
   {
     mName = name;
     // old/new value doesn't matter here
-    NotifyUnicharPropertyChanged(kNameAtom, name, name);
+    NotifyUnicharPropertyChanged(kName, name, name);
   }
   return NS_OK;
 }
 
 //For default, just return name
 NS_IMETHODIMP nsMsgDBFolder::GetAbbreviatedName(nsAString& aAbbreviatedName)
 {
   return GetName(aAbbreviatedName);
@@ -3981,17 +4006,16 @@ nsresult nsMsgDBFolder::GetBackupSummary
 
   backupDBFile.swap(*aBackupFile);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::Rename(const nsAString& aNewName, nsIMsgWindow *msgWindow)
 {
   nsCOMPtr<nsIFile> oldPathFile;
-  nsCOMPtr<nsIAtom> folderRenameAtom;
   nsresult rv = GetFilePath(getter_AddRefs(oldPathFile));
   if (NS_FAILED(rv))
     return rv;
   nsCOMPtr<nsIMsgFolder> parentFolder;
   rv = GetParent(getter_AddRefs(parentFolder));
   if (!parentFolder)
     return NS_ERROR_FAILURE;
   nsCOMPtr<nsISupports> parentSupport = do_QueryInterface(parentFolder);
@@ -4071,18 +4095,17 @@ NS_IMETHODIMP nsMsgDBFolder::Rename(cons
         newFolder->RenameSubFolders(msgWindow, this);
 
       if (parentFolder)
       {
         SetParent(nullptr);
         parentFolder->PropagateDelete(this, false, msgWindow);
         parentFolder->NotifyItemAdded(newFolder);
       }
-      folderRenameAtom = MsgGetAtom("RenameCompleted");
-      newFolder->NotifyFolderEvent(folderRenameAtom);
+      newFolder->NotifyFolderEvent(kRenameCompleted);
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::RenameSubFolders(nsIMsgWindow *msgWindow, nsIMsgFolder *oldFolder)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
@@ -4156,20 +4179,20 @@ NS_IMETHODIMP nsMsgDBFolder::UpdateSumma
   
   if (NS_SUCCEEDED(rv))
   {
     int32_t newUnreadMessages = mNumUnreadMessages + mNumPendingUnreadMessages;
     int32_t newTotalMessages = mNumTotalMessages + mNumPendingTotalMessages;
 
     //Need to notify listeners that total count changed.
     if(oldTotalMessages != newTotalMessages)
-      NotifyIntPropertyChanged(kTotalMessagesAtom, oldTotalMessages, newTotalMessages);
+      NotifyIntPropertyChanged(kTotalMessages, oldTotalMessages, newTotalMessages);
 
     if(oldUnreadMessages != newUnreadMessages)
-      NotifyIntPropertyChanged(kTotalUnreadMessagesAtom, oldUnreadMessages, newUnreadMessages);
+      NotifyIntPropertyChanged(kTotalUnreadMessages, oldUnreadMessages, newUnreadMessages);
 
     FlushToFolderCache();
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::SummaryChanged()
 {
@@ -4261,17 +4284,17 @@ NS_IMETHODIMP nsMsgDBFolder::ChangeNumPe
     NS_ASSERTION(newUnreadMessages >= 0, "shouldn't have negative unread message count");
     if (newUnreadMessages >= 0)
     {
       nsCOMPtr<nsIMsgDatabase> db;
       nsCOMPtr<nsIDBFolderInfo> folderInfo;
       nsresult rv = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
       if (NS_SUCCEEDED(rv) && folderInfo)
         folderInfo->SetImapUnreadPendingMessages(mNumPendingUnreadMessages);
-      NotifyIntPropertyChanged(kTotalUnreadMessagesAtom, oldUnreadMessages, newUnreadMessages);
+      NotifyIntPropertyChanged(kTotalUnreadMessages, oldUnreadMessages, newUnreadMessages);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::ChangeNumPendingTotalMessages(int32_t delta)
 {
   if (delta)
@@ -4280,17 +4303,17 @@ NS_IMETHODIMP nsMsgDBFolder::ChangeNumPe
     mNumPendingTotalMessages += delta;
     int32_t newTotalMessages = mNumTotalMessages + mNumPendingTotalMessages;
 
     nsCOMPtr<nsIMsgDatabase> db;
     nsCOMPtr<nsIDBFolderInfo> folderInfo;
     nsresult rv = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
     if (NS_SUCCEEDED(rv) && folderInfo)
       folderInfo->SetImapTotalPendingMessages(mNumPendingTotalMessages);
-    NotifyIntPropertyChanged(kTotalMessagesAtom, oldTotalMessages, newTotalMessages);
+    NotifyIntPropertyChanged(kTotalMessages, oldTotalMessages, newTotalMessages);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::SetFlag(uint32_t flag)
 {
   // If calling this function causes us to open the db (i.e., it was not
   // open before), we're going to close the db before returning.
@@ -4360,29 +4383,29 @@ NS_IMETHODIMP nsMsgDBFolder::OnFlagChang
      rv = GetName(name);
      NS_ASSERTION(Compare(name, kLocalizedTrashName) || (mFlags & nsMsgFolderFlags::Trash), "lost trash flag");
 #endif
     folderInfo->SetFlags((int32_t) mFlags);
     if (db)
       db->Commit(nsMsgDBCommitType::kLargeCommit);
 
     if (mFlags & flag)
-      NotifyIntPropertyChanged(mFolderFlagAtom, mFlags & ~flag, mFlags);
+      NotifyIntPropertyChanged(kFolderFlag, mFlags & ~flag, mFlags);
     else
-      NotifyIntPropertyChanged(mFolderFlagAtom, mFlags | flag, mFlags);
+      NotifyIntPropertyChanged(kFolderFlag, mFlags | flag, mFlags);
 
     if (flag & nsMsgFolderFlags::Offline)
     {
       bool newValue = mFlags & nsMsgFolderFlags::Offline;
-      rv = NotifyBoolPropertyChanged(kSynchronizeAtom, !newValue, !!newValue);
+      rv = NotifyBoolPropertyChanged(kSynchronize, !newValue, !!newValue);
     }
     else if (flag & nsMsgFolderFlags::Elided)
     {
       bool newValue = mFlags & nsMsgFolderFlags::Elided;
-      rv = NotifyBoolPropertyChanged(kOpenAtom, !!newValue, !newValue);
+      rv = NotifyBoolPropertyChanged(kOpen, !!newValue, !newValue);
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::SetFlags(uint32_t aFlags)
 {
   if (mFlags != aFlags)
@@ -4528,17 +4551,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetSizeOnDi
 {
   NS_ENSURE_ARG_POINTER(size);
   *size = kSizeUnknown;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::SetSizeOnDisk(int64_t aSizeOnDisk)
 {
-  NotifyIntPropertyChanged(kFolderSizeAtom, mFolderSize, aSizeOnDisk);
+  NotifyIntPropertyChanged(kFolderSize, mFolderSize, aSizeOnDisk);
   mFolderSize = aSizeOnDisk;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::GetUsername(nsACString& userName)
 {
   nsresult rv;
   nsCOMPtr <nsIMsgIncomingServer> server;
@@ -4585,24 +4608,24 @@ NS_IMETHODIMP nsMsgDBFolder::SetBiffStat
       nsCOMPtr<nsIMsgFolder> folder;
       rv = GetRootFolder(getter_AddRefs(folder));
       if (NS_SUCCEEDED(rv) && folder)
         return folder->SetBiffState(aBiffState);
     }
     if (server)
       server->SetBiffState(aBiffState);
 
-    NotifyIntPropertyChanged(kBiffStateAtom, oldBiffState, aBiffState);
+    NotifyIntPropertyChanged(kBiffState, oldBiffState, aBiffState);
   }
   else if (aBiffState == oldBiffState && aBiffState == nsMsgBiffState_NewMail)
   {
     // The folder has been updated, so update the MRUTime
     SetMRUTime();
     // biff is already set, but notify that there is additional new mail for the folder
-    NotifyIntPropertyChanged(kNewMailReceivedAtom, 0, mNumNewBiffMessages);
+    NotifyIntPropertyChanged(kNewMailReceived, 0, mNumNewBiffMessages);
   }
   else if (aBiffState == nsMsgBiffState_NoMail)
   {
     // even if the old biff state equals the new biff state, it is still possible that we've never
     // cleared the number of new messages for this particular folder. This happens when the new mail state
     // got cleared by viewing a new message in folder that is different from this one. Biff state is stored per server
     //  the num. of new messages is per folder.
     SetNumNewMessages(0);
@@ -4637,17 +4660,17 @@ NS_IMETHODIMP nsMsgDBFolder::SetNumNewMe
   {
     int32_t oldNumMessages = mNumNewBiffMessages;
     mNumNewBiffMessages = aNumNewMessages;
 
     nsAutoCString oldNumMessagesStr;
     oldNumMessagesStr.AppendInt(oldNumMessages);
     nsAutoCString newNumMessagesStr;
     newNumMessagesStr.AppendInt(aNumNewMessages);
-    NotifyPropertyChanged(kNumNewBiffMessagesAtom, oldNumMessagesStr, newNumMessagesStr);
+    NotifyPropertyChanged(kNumNewBiffMessages, oldNumMessagesStr, newNumMessagesStr);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::GetRootFolder(nsIMsgFolder * *aRootFolder)
 {
   NS_ENSURE_ARG_POINTER(aRootFolder);
   nsresult rv;
@@ -4886,17 +4909,17 @@ NS_IMETHODIMP nsMsgDBFolder::CopyDataToO
 }
 
 NS_IMETHODIMP nsMsgDBFolder::CopyDataDone()
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgDBFolder::NotifyPropertyChanged(nsIAtom *aProperty,
+nsMsgDBFolder::NotifyPropertyChanged(const nsACString &aProperty,
                                      const nsACString& aOldValue,
                                      const nsACString& aNewValue)
 {
   NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(mListeners, nsIFolderListener,
                                      OnItemPropertyChanged,
                                      (this, aProperty,
                                       nsCString(aOldValue).get(),
                                       nsCString(aNewValue).get()));
@@ -4907,17 +4930,17 @@ nsMsgDBFolder::NotifyPropertyChanged(nsI
            do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return folderListenerManager->OnItemPropertyChanged(this, aProperty,
                                                       nsCString(aOldValue).get(),
                                                       nsCString(aNewValue).get());
 }
 
 NS_IMETHODIMP
-nsMsgDBFolder::NotifyUnicharPropertyChanged(nsIAtom *aProperty,
+nsMsgDBFolder::NotifyUnicharPropertyChanged(const nsACString &aProperty,
                                           const nsAString& aOldValue,
                                           const nsAString& aNewValue)
 {
   NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(mListeners, nsIFolderListener,
                                      OnItemUnicharPropertyChanged,
                                      (this, aProperty,
                                       nsString(aOldValue).get(),
                                       nsString(aNewValue).get()));
@@ -4929,57 +4952,57 @@ nsMsgDBFolder::NotifyUnicharPropertyChan
   NS_ENSURE_SUCCESS(rv, rv);
   return folderListenerManager->OnItemUnicharPropertyChanged(this,
                                                  aProperty,
                                                  nsString(aOldValue).get(),
                                                  nsString(aNewValue).get());
 }
 
 NS_IMETHODIMP
-nsMsgDBFolder::NotifyIntPropertyChanged(nsIAtom *aProperty, int64_t aOldValue,
+nsMsgDBFolder::NotifyIntPropertyChanged(const nsACString &aProperty, int64_t aOldValue,
                                         int64_t aNewValue)
 {
   // Don't send off count notifications if they are turned off.
   if (!mNotifyCountChanges &&
-      ((aProperty == kTotalMessagesAtom) ||
-       (aProperty == kTotalUnreadMessagesAtom)))
+      (aProperty.Equals(kTotalMessages)  ||
+       aProperty.Equals(kTotalUnreadMessages)))
     return NS_OK;
 
   NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(mListeners, nsIFolderListener,
                                      OnItemIntPropertyChanged,
                                      (this, aProperty, aOldValue, aNewValue));
 
   // Notify listeners who listen to every folder
   nsresult rv;
   nsCOMPtr<nsIFolderListener> folderListenerManager =
            do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return folderListenerManager->OnItemIntPropertyChanged(this, aProperty,
                                                          aOldValue, aNewValue);
 }
 
 NS_IMETHODIMP
-nsMsgDBFolder::NotifyBoolPropertyChanged(nsIAtom* aProperty,
+nsMsgDBFolder::NotifyBoolPropertyChanged(const nsACString &aProperty,
                                          bool aOldValue, bool aNewValue)
 {
   NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(mListeners, nsIFolderListener,
                                      OnItemBoolPropertyChanged,
                                      (this, aProperty, aOldValue, aNewValue));
 
   // Notify listeners who listen to every folder
   nsresult rv;
   nsCOMPtr<nsIFolderListener> folderListenerManager =
            do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return folderListenerManager->OnItemBoolPropertyChanged(this, aProperty,
                                                           aOldValue, aNewValue);
 }
 
 NS_IMETHODIMP
-nsMsgDBFolder::NotifyPropertyFlagChanged(nsIMsgDBHdr *aItem, nsIAtom *aProperty,
+nsMsgDBFolder::NotifyPropertyFlagChanged(nsIMsgDBHdr *aItem, const nsACString &aProperty,
                                          uint32_t aOldValue, uint32_t aNewValue)
 {
   NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(mListeners, nsIFolderListener,
                                      OnItemPropertyFlagChanged,
                                      (aItem, aProperty, aOldValue, aNewValue));
 
   // Notify listeners who listen to every folder
   nsresult rv;
@@ -5018,17 +5041,17 @@ nsresult nsMsgDBFolder::NotifyItemRemove
   // Notify listeners who listen to every folder
   nsresult rv;
   nsCOMPtr<nsIFolderListener> folderListenerManager =
            do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return folderListenerManager->OnItemRemoved(this, aItem);
 }
 
-nsresult nsMsgDBFolder::NotifyFolderEvent(nsIAtom* aEvent)
+nsresult nsMsgDBFolder::NotifyFolderEvent(const nsACString &aEvent)
 {
   NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(mListeners, nsIFolderListener,
                                      OnItemEvent,
                                      (this, aEvent));
 
   //Notify listeners who listen to every folder
   nsresult rv;
   nsCOMPtr<nsIFolderListener> folderListenerManager =
@@ -5403,17 +5426,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetInVFEdit
   *aInVFEditSearchScope = mInVFEditSearchScope;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::SetInVFEditSearchScope (bool aInVFEditSearchScope, bool aSetOnSubFolders)
 {
   bool oldInVFEditSearchScope = mInVFEditSearchScope;
   mInVFEditSearchScope = aInVFEditSearchScope;
-  NotifyBoolPropertyChanged(kInVFEditSearchScopeAtom, oldInVFEditSearchScope, mInVFEditSearchScope);
+  NotifyBoolPropertyChanged(kInVFEditSearchScope, oldInVFEditSearchScope, mInVFEditSearchScope);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::FetchMsgPreviewText(nsMsgKey *aKeysToFetch, uint32_t aNumKeys,
                                                  bool aLocalOnly, nsIUrlListener *aUrlListener,
                                                  bool *aAsyncResults)
 {
   NS_ENSURE_ARG_POINTER(aKeysToFetch);
@@ -5748,18 +5771,17 @@ void nsMsgDBFolder::UpdateTimestamps(boo
     SetMRUTime();
     if (allowUndo) // This is a proxy for a user-initiated act.
     {
       bool isArchive;
       IsSpecialFolder(nsMsgFolderFlags::Archive, true, &isArchive);
       if (!isArchive)
       {
         SetMRMTime();
-        nsCOMPtr<nsIAtom> MRMTimeChangedAtom = MsgGetAtom("MRMTimeChanged");
-        NotifyFolderEvent(MRMTimeChangedAtom);
+        NotifyFolderEvent(kMRMTimeChanged);
       }
     }
   }
 }
 
 void nsMsgDBFolder::SetMRUTime()
 {
   uint32_t seconds;
--- a/mailnews/base/util/nsMsgDBFolder.h
+++ b/mailnews/base/util/nsMsgDBFolder.h
@@ -9,33 +9,70 @@
 #include "mozilla/Attributes.h"
 #include "msgCore.h"
 #include "nsIMsgFolder.h" 
 #include "nsRDFResource.h"
 #include "nsIDBFolderInfo.h"
 #include "nsIMsgDatabase.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsCOMPtr.h"
-#include "nsStaticAtom.h"
 #include "nsIDBChangeListener.h"
 #include "nsIMsgPluggableStore.h"
 #include "nsIURL.h"
 #include "nsIFile.h"
 #include "nsWeakReference.h"
 #include "nsIMsgFilterList.h"
 #include "nsIUrlListener.h"
 #include "nsIMsgHdr.h"
 #include "nsIOutputStream.h"
 #include "nsITransport.h"
 #include "nsIStringBundle.h"
 #include "nsTObserverArray.h"
 #include "nsCOMArray.h"
 #include "nsMsgKeySet.h"
 #include "nsMsgMessageFlags.h"
 #include "nsIMsgFilterPlugin.h"
+
+// We declare strings for folder properties and events.
+// Properties:
+extern const nsLiteralCString kBiffState;
+extern const nsLiteralCString kCanFileMessages;
+extern const nsLiteralCString kDefaultServer;
+extern const nsLiteralCString kFlagged;
+extern const nsLiteralCString kFolderFlag;
+extern const nsLiteralCString kFolderSize;
+extern const nsLiteralCString kInVFEditSearchScope;
+extern const nsLiteralCString kIsDeferred;
+extern const nsLiteralCString kIsSecure;
+extern const nsLiteralCString kJunkStatusChanged;
+extern const nsLiteralCString kKeywords;
+extern const nsLiteralCString kMRMTimeChanged;
+extern const nsLiteralCString kMsgLoaded;
+extern const nsLiteralCString kName;
+extern const nsLiteralCString kNewMailReceived;
+extern const nsLiteralCString kNewMessages;
+extern const nsLiteralCString kOpen;
+extern const nsLiteralCString kSortOrder;
+extern const nsLiteralCString kStatus;
+extern const nsLiteralCString kSynchronize;
+extern const nsLiteralCString kTotalMessages;
+extern const nsLiteralCString kTotalUnreadMessages;
+
+// Events:
+extern const nsLiteralCString kAboutToCompact;
+extern const nsLiteralCString kCompactCompleted;
+extern const nsLiteralCString kDeleteOrMoveMsgCompleted;
+extern const nsLiteralCString kDeleteOrMoveMsgFailed;
+extern const nsLiteralCString kFiltersApplied;
+extern const nsLiteralCString kFolderCreateCompleted;
+extern const nsLiteralCString kFolderCreateFailed;
+extern const nsLiteralCString kFolderLoaded;
+extern const nsLiteralCString kNumNewBiffMessages;
+extern const nsLiteralCString kRenameCompleted;
+
 class nsIMsgFolderCacheElement;
 class nsICollation;
 class nsMsgKeySetU;
 
  /* 
   * nsMsgDBFolder
   * class derived from nsMsgFolder for those folders that use an nsIMsgDatabase
   */ 
@@ -66,34 +103,34 @@ public:
   // nsRDFResource overrides
   NS_IMETHOD Init(const char* aURI) override;
 
   nsresult CreateDirectoryForFolder(nsIFile **result);
   nsresult CreateBackupDirectory(nsIFile **result);
   nsresult GetBackupSummaryFile(nsIFile **result, const nsACString& newName);
   nsresult GetMsgPreviewTextFromStream(nsIMsgDBHdr *msgHdr, nsIInputStream *stream);
   nsresult HandleAutoCompactEvent(nsIMsgWindow *aMsgWindow);
+
 protected:
   virtual ~nsMsgDBFolder();
-  
+
   virtual nsresult CreateBaseMessageURI(const nsACString& aURI);
 
   void compressQuotesInMsgSnippet(const nsString& aMessageText, nsAString& aCompressedQuotesStr);
   void decodeMsgSnippet(const nsACString& aEncodingType, bool aIsComplete, nsCString& aMsgSnippet);
 
   // helper routine to parse the URI and update member variables
   nsresult parseURI(bool needServer=false);
   nsresult GetBaseStringBundle(nsIStringBundle **aBundle);
   nsresult GetStringFromBundle(const char* msgName, nsString& aResult);
   nsresult ThrowConfirmationPrompt(nsIMsgWindow *msgWindow, const nsAString& confirmString, bool *confirmed);
   nsresult GetWarnFilterChanged(bool *aVal);
   nsresult SetWarnFilterChanged(bool aVal);
   nsresult CreateCollationKey(const nsString &aSource,  uint8_t **aKey, uint32_t *aLength);
 
-protected:
   // all children will override this to create the right class of object.
   virtual nsresult CreateChildFromURI(const nsCString &uri, nsIMsgFolder **folder) = 0;
   virtual nsresult ReadDBFolderInfo(bool force);
   virtual nsresult FlushToFolderCache();
   virtual nsresult GetDatabase() = 0;
   virtual nsresult SendFlagNotifications(nsIMsgDBHdr *item, uint32_t oldFlags, uint32_t newFlags);
   nsresult CheckWithNewMessagesStatus(bool messageAdded);
   void     UpdateNewMessages();
@@ -147,17 +184,16 @@ protected:
 
   /**
    * Produce an array of messages ordered like the input keys.
    */
   nsresult MessagesInKeyOrder(nsTArray<nsMsgKey> &aKeyArray,
                               nsIMsgFolder *srcFolder,
                               nsIMutableArray* messages);
 
-protected:
   nsCOMPtr<nsIMsgDatabase> mDatabase;
   nsCOMPtr<nsIMsgDatabase> mBackupDatabase;
   nsCString mCharset;
   bool mCharsetOverride;
   bool mAddListener;
   bool mNewMessages;
   bool mGettingNewMessages;
   nsMsgKey mLastMessageLoaded;
@@ -167,17 +203,16 @@ protected:
   int32_t m_bytesAddedToLocalMsg;
   // this is currently used when we do a save as of an imap or news message..
   nsCOMPtr<nsIOutputStream> m_tempMessageStream;
 
   nsCOMPtr <nsIMsgRetentionSettings> m_retentionSettings;
   nsCOMPtr <nsIMsgDownloadSettings> m_downloadSettings;
   static NS_MSG_BASE_STATIC_MEMBER_(nsrefcnt) mInstanceCount;
 
-protected:
   uint32_t mFlags;
   nsWeakPtr mParent;     //This won't be refcounted for ownership reasons.
   int32_t mNumUnreadMessages;        /* count of unread messages (-1 means unknown; -2 means unknown but we already tried to find out.) */
   int32_t mNumTotalMessages;         /* count of existing messages. */
   bool mNotifyCountChanges;
   int64_t mExpungedBytes;
   nsCOMArray<nsIMsgFolder> mSubFolders;
   // This can't be refcounted due to ownsership issues
@@ -232,23 +267,20 @@ protected:
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedSentName;
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedDraftsName;
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedTemplatesName;
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedUnsentName;
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedJunkName;
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedArchivesName;
 
   static NS_MSG_BASE_STATIC_MEMBER_(nsString) kLocalizedBrandShortName;
-  
-#define MSGDBFOLDER_ATOM(name_, value) static NS_MSG_BASE_STATIC_MEMBER_(nsIAtom*) name_;
-#include "nsMsgDBFolderAtomList.h"
-#undef MSGDBFOLDER_ATOM
 
   static NS_MSG_BASE_STATIC_MEMBER_(nsICollation*) gCollationKeyGenerator;
 
+
   // store of keys that have a processing flag set
   struct
   {
     uint32_t bit;
     nsMsgKeySetU* keys;
   } mProcessingFlag[nsMsgProcessingFlags::NumberOfFlags];
 
   // list of nsIMsgDBHdrs for messages to process post-bayes
deleted file mode 100644
--- a/mailnews/base/util/nsMsgDBFolderAtomList.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-MSGDBFOLDER_ATOM(kTotalUnreadMessagesAtom, "TotalUnreadMessages")
-MSGDBFOLDER_ATOM(kBiffStateAtom, "BiffState")
-MSGDBFOLDER_ATOM(kNewMailReceivedAtom, "NewMailReceived")
-MSGDBFOLDER_ATOM(kNewMessagesAtom, "NewMessages")
-MSGDBFOLDER_ATOM(kInVFEditSearchScopeAtom, "inVFEditSearchScope")
-MSGDBFOLDER_ATOM(kNumNewBiffMessagesAtom, "NumNewBiffMessages")
-MSGDBFOLDER_ATOM(kTotalMessagesAtom, "TotalMessages")
-MSGDBFOLDER_ATOM(kFolderSizeAtom, "FolderSize")
-MSGDBFOLDER_ATOM(kStatusAtom, "Status")
-MSGDBFOLDER_ATOM(kFlaggedAtom, "Flagged")
-MSGDBFOLDER_ATOM(kNameAtom, "Name")
-MSGDBFOLDER_ATOM(kSynchronizeAtom, "Synchronize")
-MSGDBFOLDER_ATOM(kOpenAtom, "open")
-MSGDBFOLDER_ATOM(kIsDeferred, "isDeferred")
-MSGDBFOLDER_ATOM(kKeywords, "Keywords")
-MSGDBFOLDER_ATOM(mFolderLoadedAtom, "FolderLoaded")
-MSGDBFOLDER_ATOM(mDeleteOrMoveMsgCompletedAtom, "DeleteOrMoveMsgCompleted")
-MSGDBFOLDER_ATOM(mDeleteOrMoveMsgFailedAtom, "DeleteOrMoveMsgFailed")
-MSGDBFOLDER_ATOM(mJunkStatusChangedAtom, "JunkStatusChanged")
-MSGDBFOLDER_ATOM(mFiltersAppliedAtom, "FiltersApplied")
-MSGDBFOLDER_ATOM(mFolderFlagAtom, "FolderFlag")
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -13,16 +13,17 @@
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsISupportsPrimitives.h"
 
 #include "nsIMsgBiffManager.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgDBCID.h"
 #include "nsIMsgFolder.h"
+#include "nsMsgDBFolder.h"
 #include "nsIMsgFolderCache.h"
 #include "nsIMsgPluggableStore.h"
 #include "nsIMsgFolderCacheElement.h"
 #include "nsIMsgWindow.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMsgProtocolInfo.h"
 #include "nsIMutableArray.h"
 #include "nsIPrefService.h"
@@ -1766,18 +1767,17 @@ NS_IMETHODIMP nsMsgIncomingServer::SetSo
   nsresult rv = mPrefBranch->SetIntPref("socketType", aSocketType);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool isSecureOld = (socketType == nsMsgSocketType::alwaysSTARTTLS ||
                         socketType == nsMsgSocketType::SSL);
   bool isSecureNew = (aSocketType == nsMsgSocketType::alwaysSTARTTLS ||
                         aSocketType == nsMsgSocketType::SSL);
   if ((isSecureOld != isSecureNew) && m_rootFolder) {
-    nsCOMPtr <nsIAtom> isSecureAtom = MsgGetAtom("isSecure");
-    m_rootFolder->NotifyBoolPropertyChanged(isSecureAtom,
+    m_rootFolder->NotifyBoolPropertyChanged(kIsSecure,
                                             isSecureOld, isSecureNew);
   }
   return NS_OK;
 }
 
 // Check if the password is available and return a boolean indicating whether
 // it is being authenticated or not.
 NS_IMETHODIMP
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -10,17 +10,16 @@
 #include "nsString.h"
 #include "msgCore.h"
 #include "nsCOMPtr.h"
 #include "MailNewsTypes2.h"
 #include "nsTArray.h"
 #include "nsInterfaceRequestorAgg.h"
 #include "nsILoadGroup.h"
 #include "nsIArray.h"
-#include "nsIAtom.h"
 #include "nsINetUtil.h"
 #include "nsIRequest.h"
 #include "nsILoadInfo.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsIFile.h"
 
 class nsIChannel;
@@ -340,20 +339,16 @@ ConvertBufToPlainText(nsString &aConBuf,
 #define MsgReplaceSubstring(str, what, replacement) \
         (str).ReplaceSubstring(what, replacement)
 #define MsgIsUTF8(str) \
         IsUTF8(str)
 #define MsgNewInterfaceRequestorAggregation(aFirst, aSecond, aResult) \
         NS_NewInterfaceRequestorAggregation(aFirst, aSecond, aResult)
 #define MsgNewNotificationCallbacksAggregation(aCallbacks, aLoadGroup, aResult) \
         NS_NewNotificationCallbacksAggregation(aCallbacks, aLoadGroup, aResult)
-#define MsgGetAtom(aString) \
-        NS_Atomize(aString)
-#define MsgNewAtom(aString) \
-        NS_Atomize(aString)
 #define MsgReplaceChar(aString, aNeedle, aReplacement) \
         (aString).ReplaceChar(aNeedle, aReplacement)
 #define MsgFind(str, what, ignore_case, offset) \
         (str).Find(what, ignore_case, offset)
 #define MsgCountChar(aString, aChar) \
         (aString).CountChar(aChar)
 
 /**
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -1469,55 +1469,55 @@ nsMsgSendLater::OnItemAdded(nsIMsgFolder
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemRemoved(nsIMsgFolder *aParentItem, nsISupports *aItem)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgSendLater::OnItemPropertyChanged(nsIMsgFolder *aItem, nsIAtom *aProperty,
+nsMsgSendLater::OnItemPropertyChanged(nsIMsgFolder *aItem, const nsACString &aProperty,
                                       const char* aOldValue,
                                       const char* aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgSendLater::OnItemIntPropertyChanged(nsIMsgFolder *aItem, nsIAtom *aProperty,
+nsMsgSendLater::OnItemIntPropertyChanged(nsIMsgFolder *aItem, const nsACString &aProperty,
                                          int64_t aOldValue, int64_t aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgSendLater::OnItemBoolPropertyChanged(nsIMsgFolder *aItem, nsIAtom *aProperty,
+nsMsgSendLater::OnItemBoolPropertyChanged(nsIMsgFolder *aItem, const nsACString &aProperty,
                                           bool aOldValue, bool aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemUnicharPropertyChanged(nsIMsgFolder *aItem,
-                                             nsIAtom *aProperty,
+                                             const nsACString &aProperty,
                                              const char16_t* aOldValue,
                                              const char16_t* aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgSendLater::OnItemPropertyFlagChanged(nsIMsgDBHdr *aItem, nsIAtom *aProperty,
+nsMsgSendLater::OnItemPropertyFlagChanged(nsIMsgDBHdr *aItem, const nsACString &aProperty,
                                           uint32_t aOldValue, uint32_t aNewValue)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsMsgSendLater::OnItemEvent(nsIMsgFolder* aItem, nsIAtom *aEvent)
+nsMsgSendLater::OnItemEvent(nsIMsgFolder* aItem, const nsACString &aEvent)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::GetNeedsToRunTask(bool *aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
--- a/mailnews/compose/src/nsMsgSendLater.h
+++ b/mailnews/compose/src/nsMsgSendLater.h
@@ -10,16 +10,17 @@
 #include "nsIMsgFolder.h"
 #include "nsIMsgSendListener.h"
 #include "nsIMsgSendLaterListener.h"
 #include "nsIMsgSendLater.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsTObserverArray.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
+#include "nsCOMPtr.h"
 #include "nsIMsgShutdown.h"
 
 ////////////////////////////////////////////////////////////////////////////////////
 // This is the listener class for the send operation. We have to create this class 
 // to listen for message send completion and eventually notify the caller
 ////////////////////////////////////////////////////////////////////////////////////
 class nsMsgSendLater;
 
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -1372,19 +1372,17 @@ NS_IMETHODIMP nsImapIncomingServer::Onli
         nsCOMPtr <nsIMsgFolder> newFolder;
         nsString unicodeNewName;
         // tmpNewName is imap mod utf7. It needs to be convert to utf8.
         CopyMUTF7toUTF16(tmpNewName, unicodeNewName);
         CopyUTF16toUTF8(unicodeNewName, tmpNewName);
         rv = GetFolder(tmpNewName, getter_AddRefs(newFolder));
         if (NS_SUCCEEDED(rv))
         {
-          nsCOMPtr <nsIAtom> folderRenameAtom;
-          folderRenameAtom = MsgGetAtom("RenameCompleted");
-          newFolder->NotifyFolderEvent(folderRenameAtom);
+          newFolder->NotifyFolderEvent(kRenameCompleted);
         }
       }
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP  nsImapIncomingServer::FolderIsNoSelect(const nsACString& aFolderName, bool *result)
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -822,23 +822,23 @@ NS_IMETHODIMP nsImapMailFolder::UpdateFo
     {
       if (aMsgWindow)
         AutoCompact(aMsgWindow);
     }
 
     if (rv == NS_MSG_ERROR_OFFLINE || rv == NS_BINDING_ABORTED)
     {
       rv = NS_OK;
-      NotifyFolderEvent(mFolderLoadedAtom);
+      NotifyFolderEvent(kFolderLoaded);
     }
   }
   else if (NS_SUCCEEDED(rv))  // tell the front end that the folder is loaded if we're not going to
   {                           // actually run a url.
     if (!m_updatingFolder)    // if we're already running an update url, we'll let that one send the folder loaded
-      NotifyFolderEvent(mFolderLoadedAtom);
+      NotifyFolderEvent(kFolderLoaded);
   }
   return rv;
 }
 
 NS_IMETHODIMP nsImapMailFolder::GetMessages(nsISimpleEnumerator* *result)
 {
   NS_ENSURE_ARG_POINTER(result);
   if (!mDatabase)
@@ -1002,30 +1002,27 @@ NS_IMETHODIMP nsImapMailFolder::CreateCl
     unusedDB->Commit(nsMsgDBCommitType::kLargeCommit);
     unusedDB->Close(true);
     // don't want to hold onto this newly created db.
     child->SetMsgDatabase(nullptr);
   }
 
   if (!suppressNotification)
   {
-    nsCOMPtr <nsIAtom> folderCreateAtom;
     if(NS_SUCCEEDED(rv) && child)
     {
       NotifyItemAdded(child);
-      folderCreateAtom = MsgGetAtom("FolderCreateCompleted");
-      child->NotifyFolderEvent(folderCreateAtom);
+      child->NotifyFolderEvent(kFolderCreateCompleted);
       nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
       if (notifier)
         notifier->NotifyFolderAdded(child);
     }
     else
     {
-      folderCreateAtom = MsgGetAtom("FolderCreateFailed");
-      NotifyFolderEvent(folderCreateAtom);
+      NotifyFolderEvent(kFolderCreateFailed);
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP nsImapMailFolder::List()
 {
   nsresult rv;
@@ -2298,17 +2295,17 @@ NS_IMETHODIMP nsImapMailFolder::DeleteMe
             nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
             if (notifier)
               notifier->NotifyMsgsDeleted(messages);
           }
           DeleteStoreMessages(messages);
           database->DeleteMessages(srcKeyArray.Length(), srcKeyArray.Elements(), nullptr);
           EnableNotifications(allMessageCountNotifications, true);
         }
-        NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+        NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
       }
     }
     return rv;
   }
 
   // have to move the messages to the trash
   if(trashFolder)
   {
@@ -3148,17 +3145,17 @@ nsresult nsImapMailFolder::NormalEndHead
           !m_filterListRequiresBody)
       {
         if (m_filterList)
         {
           GetMoveCoalescer();  // not sure why we're doing this here.
           m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, newMsgHdr,
                                           this, mDatabase, headers, headersSize,
                                           this, msgWindow);
-          NotifyFolderEvent(mFiltersAppliedAtom);
+          NotifyFolderEvent(kFiltersApplied);
         }
       }
     }
   }
   // here we need to tweak flags from uid state..
   if (mDatabase && (!m_msgMovedByFilter || ShowDeletedMessages()))
   {
     nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
@@ -4677,17 +4674,17 @@ nsImapMailFolder::NormalEndMsgWriteStrea
         nsCOMPtr<nsIMsgMailNewsUrl> msgUrl;
         msgUrl = do_QueryInterface(imapUrl, &rv);
         if (msgUrl && NS_SUCCEEDED(rv))
           msgUrl->GetMsgWindow(getter_AddRefs(msgWindow));
       }
       m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, newMsgHdr,
                                       this, mDatabase, nullptr, 0, this,
                                       msgWindow);
-      NotifyFolderEvent(mFiltersAppliedAtom);
+      NotifyFolderEvent(kFiltersApplied);
     }
     // Process filter plugins and other items normally done at the end of
     // HeaderFetchCompleted.
     bool pendingMoves = m_moveCoalescer && m_moveCoalescer->HasPendingMoves();
     PlaybackCoalescedOperations();
 
     bool filtersRun;
     CallFilterPlugins(nullptr, &filtersRun);
@@ -4754,17 +4751,17 @@ nsImapMailFolder::OnlineCopyCompleted(ns
                                       true);
   }
   /* unhandled copystate */
   if (m_copyState) // whoops, this is the wrong folder - should use the source folder
   {
     nsCOMPtr<nsIMsgFolder> srcFolder;
     srcFolder = do_QueryInterface(m_copyState->m_srcSupport, &rv);
     if (srcFolder)
-      srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+      srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
   }
   else
     rv = NS_ERROR_FAILURE;
 
   return rv;
 }
 
 NS_IMETHODIMP
@@ -4872,17 +4869,17 @@ nsresult nsImapMailFolder::SyncFlags(nsI
         HandleCustomFlags(uidOfMessage, dbHdr, supportedUserFlags, keywords);
 
     NotifyMessageFlagsFromHdr(dbHdr, uidOfMessage, flags);
   }
   if (!partialUIDFetch && newFolderSize != mFolderSize)
   {
     int64_t oldFolderSize = mFolderSize;
     mFolderSize = newFolderSize;
-    NotifyIntPropertyChanged(kFolderSizeAtom, oldFolderSize, mFolderSize);
+    NotifyIntPropertyChanged(kFolderSize, oldFolderSize, mFolderSize);
   }
 
   return NS_OK;
 }
 
 // helper routine to sync the flags on a given header
 nsresult
 nsImapMailFolder::NotifyMessageFlagsFromHdr(nsIMsgDBHdr *dbHdr,
@@ -5296,17 +5293,17 @@ nsImapMailFolder::OnStopRunningUrl(nsIUR
                   srcDB->DeleteMessages(srcKeyArray.Length(), srcKeyArray.Elements(), nullptr);
                 }
                 else
                   MarkMessagesImapDeleted(&srcKeyArray, true, srcDB);
               }
               srcFolder->EnableNotifications(allMessageCountNotifications, true);
               // even if we're showing deleted messages,
               // we still need to notify FE so it will show the imap deleted flag
-              srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+              srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
               // is there a way to see that we think we have new msgs?
               nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
               if (NS_SUCCEEDED(rv))
               {
                 bool showPreviewText;
                 prefBranch->GetBoolPref("mail.biff.alert.show_preview", &showPreviewText);
                 // if we're showing preview text, update ourselves if we got a new unread
                 // message copied so that we can download the new headers and have a chance
@@ -5314,17 +5311,17 @@ nsImapMailFolder::OnStopRunningUrl(nsIUR
                 if (!folderOpen && showPreviewText && m_copyState->m_unreadCount > 0
                     && ! (mFlags & (nsMsgFolderFlags::Trash | nsMsgFolderFlags::Junk)))
                   UpdateFolder(msgWindow);
               }
             }
             else
             {
               srcFolder->EnableNotifications(allMessageCountNotifications, true);
-              srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+              srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgFailed);
             }
 
           }
           if (m_copyState->m_msgWindow &&
               m_copyState->m_undoMsgTxn &&  // may be null from filters
               NS_SUCCEEDED(aExitCode))      //we should do this only if move/copy succeeds
           {
             nsCOMPtr<nsITransactionManager> txnMgr;
@@ -5481,19 +5478,17 @@ nsImapMailFolder::OnStopRunningUrl(nsIUR
               copyService->NotifyCompletion(m_copyState->m_srcSupport, destFolder, aExitCode);
           }
           m_copyState = nullptr;
         }
         break;
       case nsIImapUrl::nsImapRenameFolder:
         if (NS_FAILED(aExitCode))
         {
-          nsCOMPtr <nsIAtom> folderRenameAtom;
-          folderRenameAtom = MsgGetAtom("RenameCompleted");
-          NotifyFolderEvent(folderRenameAtom);
+          NotifyFolderEvent(kRenameCompleted);
         }
         break;
       case nsIImapUrl::nsImapDeleteAllMsgs:
           if (NS_SUCCEEDED(aExitCode))
           {
             if (folderOpen)
               UpdateFolder(msgWindow);
             else
@@ -5527,19 +5522,17 @@ nsImapMailFolder::OnStopRunningUrl(nsIUR
       case nsIImapUrl::nsImapRefreshFolderUrls:
         // we finished getting an admin url for the folder.
           if (!m_adminUrl.IsEmpty())
             FolderPrivileges(msgWindow);
           break;
       case nsIImapUrl::nsImapCreateFolder:
         if (NS_FAILED(aExitCode))  //if success notification already done
         {
-          nsCOMPtr <nsIAtom> folderCreateAtom;
-          folderCreateAtom = MsgGetAtom("FolderCreateFailed");
-          NotifyFolderEvent(folderCreateAtom);
+          NotifyFolderEvent(kFolderCreateFailed);
         }
         break;
       case nsIImapUrl::nsImapSubscribe:
         if (NS_SUCCEEDED(aExitCode) && msgWindow)
         {
           nsCString canonicalFolderName;
           imapUrl->CreateCanonicalSourceFolderPathString(getter_Copies(canonicalFolderName));
           nsCOMPtr <nsIMsgFolder> rootFolder;
@@ -6812,17 +6805,17 @@ nsImapMailFolder::CopyNextStreamMessage(
       if (NS_SUCCEEDED(rv) && srcFolder)
       {
         srcFolder->DeleteMessages(mailCopyState->m_messages, nullptr,
           true, true, nullptr, false);
         // we want to send this notification after the source messages have
         // been deleted.
         nsCOMPtr<nsIMsgLocalMailFolder> popFolder(do_QueryInterface(srcFolder));
         if (popFolder)   //needed if move pop->imap to notify FE
-          srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+          srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
       }
     }
   }
   if (NS_FAILED(rv))
     (void) OnCopyCompleted(mailCopyState->m_srcSupport, rv);
 
   return rv;
 }
@@ -7423,18 +7416,18 @@ nsresult nsImapMailFolder::CopyMessagesO
     srcFolder->EnableNotifications(nsIMsgFolder::allMessageCountNotifications, true);
   }
 
   nsCOMPtr<nsISupports> srcSupport = do_QueryInterface(srcFolder);
   OnCopyCompleted(srcSupport, rv);
 
   if (isMove)
     srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ?
-                                 mDeleteOrMoveMsgCompletedAtom :
-                                 mDeleteOrMoveMsgFailedAtom);
+                                 kDeleteOrMoveMsgCompleted :
+                                 kDeleteOrMoveMsgFailed);
   return rv;
 }
 
 void nsImapMailFolder::SetPendingAttributes(nsIArray* messages, bool aIsMove)
 {
 
   GetDatabase();
   if (!mDatabase)
@@ -7709,17 +7702,17 @@ nsImapMailFolder::CopyMessages(nsIMsgFol
   
 done:
   if (NS_FAILED(rv))
   {
     (void) OnCopyCompleted(srcSupport, rv);
     if (isMove)
     {
       srcFolder->EnableNotifications(allMessageCountNotifications, true);  //enable message count notification
-      NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+      NotifyFolderEvent(kDeleteOrMoveMsgFailed);
     }
   }
   return rv;
 }
 
 class nsImapFolderCopyState final : public nsIUrlListener, public nsIMsgCopyServiceListener
 {
 public:
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -427,30 +427,30 @@ nsMsgLocalMailFolder::UpdateFolder(nsIMs
   if (!mDatabase)
   {
     // return of NS_ERROR_NOT_INITIALIZED means running parsing URL
     // We don't need the return value, and assigning it to mDatabase which
     // is already set internally leaks.
     nsCOMPtr<nsIMsgDatabase> returnedDb;
     rv = GetDatabaseWithReparse(this, aWindow, getter_AddRefs(returnedDb));
     if (NS_SUCCEEDED(rv))
-      NotifyFolderEvent(mFolderLoadedAtom);
+      NotifyFolderEvent(kFolderLoaded);
   }
   else
   {
     bool valid;
     rv = mDatabase->GetSummaryValid(&valid);
     // don't notify folder loaded or try compaction if db isn't valid
     // (we're probably reparsing or copying msgs to it)
     if (NS_SUCCEEDED(rv) && valid)
-      NotifyFolderEvent(mFolderLoadedAtom);
+      NotifyFolderEvent(kFolderLoaded);
     else if (mCopyState)
       mCopyState->m_notifyFolderLoaded = true; //defer folder loaded notification
     else if (!m_parsingFolder)// if the db was already open, it's probably OK to load it if not parsing
-      NotifyFolderEvent(mFolderLoadedAtom);
+      NotifyFolderEvent(kFolderLoaded);
   }
   bool filtersRun;
   bool hasNewMessages;
   GetHasNewMessages(&hasNewMessages);
   if (mDatabase)
     ApplyRetentionSettings();
   // if we have new messages, try the filter plugins.
   if (NS_SUCCEEDED(rv) && hasNewMessages)
@@ -941,18 +941,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rena
       newFolder->SetFlags(mFlags);
       if (parentFolder)
       {
         SetParent(nullptr);
         parentFolder->PropagateDelete(this, false, msgWindow);
         parentFolder->NotifyItemAdded(newFolder);
       }
       SetFilePath(nullptr); // forget our path, since this folder object renamed itself
-      nsCOMPtr<nsIAtom> folderRenameAtom = MsgGetAtom("RenameCompleted");
-      newFolder->NotifyFolderEvent(folderRenameAtom);
+      newFolder->NotifyFolderEvent(kRenameCompleted);
 
       nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
       if (notifier)
         notifier->NotifyFolderRenamed(this, newFolder);
     }
   return rv;
 }
 
@@ -1111,17 +1110,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::GetD
 }
 
 NS_IMETHODIMP nsMsgLocalMailFolder::RefreshSizeOnDisk()
 {
   int64_t oldFolderSize = mFolderSize;
   // we set this to unknown to force it to get recalculated from disk
   mFolderSize = kSizeUnknown;
   if (NS_SUCCEEDED(GetSizeOnDisk(&mFolderSize)))
-    NotifyIntPropertyChanged(kFolderSizeAtom, oldFolderSize, mFolderSize);
+    NotifyIntPropertyChanged(kFolderSize, oldFolderSize, mFolderSize);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgLocalMailFolder::GetSizeOnDisk(int64_t *aSize)
 {
   NS_ENSURE_ARG_POINTER(aSize);
 
   bool isServer = false;
@@ -1233,17 +1232,17 @@ nsMsgLocalMailFolder::DeleteMessages(nsI
       else if (rv == NS_MSG_FOLDER_BUSY)
         ThrowAlertMsg("deletingMsgsFailed", msgWindow);
 
       // we are the source folder here for a move or shift delete
       //enable notifications because that will close the file stream
       // we've been caching, mark the db as valid, and commit it.
       EnableNotifications(allMessageCountNotifications, true);
       if (!isMove)
-        NotifyFolderEvent(NS_SUCCEEDED(rv) ? mDeleteOrMoveMsgCompletedAtom : mDeleteOrMoveMsgFailedAtom);
+        NotifyFolderEvent(NS_SUCCEEDED(rv) ? kDeleteOrMoveMsgCompleted : kDeleteOrMoveMsgFailed);
       if (msgWindow && !isMove)
         AutoCompact(msgWindow);
     }
   }
 
   if (msgWindow && !isMove && (deleteStorage || isTrashFolder)) {
     // Clear undo and redo stack.
     nsCOMPtr<nsITransactionManager> txnMgr;
@@ -1448,17 +1447,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::OnAn
     mCopyState->m_destDB = nullptr;
   return nsMsgDBFolder::OnAnnouncerGoingAway(instigator);
 }
 
 NS_IMETHODIMP
 nsMsgLocalMailFolder::OnCopyCompleted(nsISupports *srcSupport, bool moveCopySucceeded)
 {
   if (mCopyState && mCopyState->m_notifyFolderLoaded)
-    NotifyFolderEvent(mFolderLoadedAtom);
+    NotifyFolderEvent(kFolderLoaded);
 
   (void) RefreshSizeOnDisk();
   // we are the destination folder for a move/copy
   bool haveSemaphore;
   nsresult rv = TestSemaphore(static_cast<nsIMsgLocalMailFolder*>(this), &haveSemaphore);
   if (NS_SUCCEEDED(rv) && haveSemaphore)
     ReleaseSemaphore(static_cast<nsIMsgLocalMailFolder*>(this));
 
@@ -1489,17 +1488,17 @@ bool nsMsgLocalMailFolder::CheckIfSpaceF
                                                  bool isMove,
                                                  int64_t totalMsgSize)
 {
   bool spaceNotAvailable = true;
   nsresult rv = WarnIfLocalFileTooBig(msgWindow, totalMsgSize, &spaceNotAvailable);
   if (NS_FAILED(rv) || spaceNotAvailable)
   {
     if (isMove && srcFolder)
-      srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+      srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgFailed);
     OnCopyCompleted(srcSupports, false);
     return false;
   }
   return true;
 }
 
 NS_IMETHODIMP
 nsMsgLocalMailFolder::CopyMessages(nsIMsgFolder* srcFolder, nsIArray*
@@ -1510,17 +1509,17 @@ nsMsgLocalMailFolder::CopyMessages(nsIMs
 {
   nsCOMPtr<nsISupports> srcSupport = do_QueryInterface(srcFolder);
   bool isServer;
   nsresult rv = GetIsServer(&isServer);
   if (NS_SUCCEEDED(rv) && isServer)
   {
     NS_ERROR("Destination is the root folder. Cannot move/copy here");
     if (isMove)
-      srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+      srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgFailed);
     return OnCopyCompleted(srcSupport, false);
   }
 
   UpdateTimestamps(allowUndo);
   nsCString protocolType;
   rv = srcFolder->GetURI(protocolType);
   protocolType.SetLength(protocolType.FindChar(':'));
 
@@ -1547,17 +1546,17 @@ nsMsgLocalMailFolder::CopyMessages(nsIMs
       if (needOfflineBody)
       {
         bool hasMsgOffline = false;
         message->GetMessageKey(&key);
         srcFolder->HasMsgOffline(key, &hasMsgOffline);
         if (!hasMsgOffline)
         {
           if (isMove)
-            srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+            srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgFailed);
           ThrowAlertMsg("cantMoveMsgWOBodyOffline", msgWindow);
           return OnCopyCompleted(srcSupport, false);
         }
       }
     }
   }
 
   if (!CheckIfSpaceForCopy(msgWindow, srcFolder, srcSupport, isMove,
@@ -1580,18 +1579,18 @@ nsMsgLocalMailFolder::CopyMessages(nsIMs
     if (msgWindow && undoTxn)
     {
       nsCOMPtr<nsITransactionManager> txnMgr;
       msgWindow->GetTransactionManager(getter_AddRefs(txnMgr));
       if (txnMgr)
         txnMgr->DoTransaction(undoTxn);
     }
     if (isMove)
-      srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ? mDeleteOrMoveMsgCompletedAtom :
-                                                      mDeleteOrMoveMsgFailedAtom);
+      srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ? kDeleteOrMoveMsgCompleted :
+                                                      kDeleteOrMoveMsgFailed);
 
     if (NS_SUCCEEDED(rv)) {
       // If the store did the copy, like maildir, we need to mark messages on the server.
       // Otherwise that's done in EndMove().
       nsCOMPtr <nsIMsgLocalMailFolder> localDstFolder;
       QueryInterface(NS_GET_IID(nsIMsgLocalMailFolder), getter_AddRefs(localDstFolder));
       if (localDstFolder)
       {
@@ -1707,17 +1706,17 @@ nsMsgLocalMailFolder::CopyMessages(nsIMs
         (void) OnCopyCompleted(srcSupport, false);
       }
     }
   }
   // if this failed immediately, need to turn back on notifications and inform FE.
   if (NS_FAILED(rv))
   {
     if (isMove)
-      srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+      srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgFailed);
     EnableNotifications(allMessageCountNotifications, true);
   }
   return rv;
 }
 // for srcFolder that are on different server than the dstFolder.
 // "this" is the parent of the new dest folder.
 nsresult
 nsMsgLocalMailFolder::CopyFolderAcrossServer(nsIMsgFolder* srcFolder, nsIMsgWindow *msgWindow,
@@ -2564,18 +2563,18 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndC
         }
 
         // enable the dest folder
         EnableNotifications(allMessageCountNotifications, true);
         if (srcFolder && !mCopyState->m_isFolder)
         {
           // I'm not too sure of the proper location of this event. It seems to need to be
           // after the EnableNotifications, or the folder counts can be incorrect
-          // during the mDeleteOrMoveMsgCompletedAtom call.
-          srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+          // during the kDeleteOrMoveMsgCompleted call.
+          srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
         }
         (void) OnCopyCompleted(mCopyState->m_srcSupport, true);
       }
     }
     // Send the itemAdded notification in case we didn't send the itemMoveCopyCompleted notification earlier.
     // Posting news messages involves this, yet doesn't have the newHdr initialized, so don't send any
     // notifications in that case.
     if (!numHdrs && newHdr)
@@ -2621,17 +2620,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndM
   if (!mCopyState)
     return NS_OK;
 
   if (!moveSucceeded || mCopyState->m_writeFailed)
   {
     //Notify that a completion finished.
     nsCOMPtr<nsIMsgFolder> srcFolder = do_QueryInterface(mCopyState->m_srcSupport, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
-    srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+    srcFolder->NotifyFolderEvent(kDeleteOrMoveMsgFailed);
 
     /* passing true because the messages that have been successfully copied have their corressponding
                hdrs in place. The message that has failed has been truncated so the msf file and berkeley mailbox
                are in sync*/
 
     (void) OnCopyCompleted(mCopyState->m_srcSupport, true);
     // enable the dest folder
     EnableNotifications(allMessageCountNotifications, true);
@@ -2660,18 +2659,18 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndM
     // lets delete these all at once - much faster that way
     rv = srcFolder->DeleteMessages(mCopyState->m_messages, mCopyState->m_msgWindow, true, true, nullptr, mCopyState->m_allowUndo);
     AutoCompact(mCopyState->m_msgWindow);
 
     // enable the dest folder
     EnableNotifications(allMessageCountNotifications, true);
     // I'm not too sure of the proper location of this event. It seems to need to be
     // after the EnableNotifications, or the folder counts can be incorrect
-    // during the mDeleteOrMoveMsgCompletedAtom call.
-    srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ? mDeleteOrMoveMsgCompletedAtom : mDeleteOrMoveMsgFailedAtom);
+    // during the kDeleteOrMoveMsgCompleted call.
+    srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ? kDeleteOrMoveMsgCompleted : kDeleteOrMoveMsgFailed);
 
     if (NS_SUCCEEDED(rv) && mCopyState->m_msgWindow && mCopyState->m_undoMsgTxn)
     {
       nsCOMPtr<nsITransactionManager> txnMgr;
       mCopyState->m_msgWindow->GetTransactionManager(getter_AddRefs(txnMgr));
       if (txnMgr)
         txnMgr->DoTransaction(mCopyState->m_undoMsgTxn);
     }
@@ -3093,17 +3092,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Down
 
   nsCOMPtr<nsILocalMailIncomingServer> localMailServer = do_QueryInterface(server, &rv);
   NS_ENSURE_SUCCESS(rv, NS_MSG_INVALID_OR_MISSING_SERVER);
   return localMailServer->GetNewMail(aWindow, this, this, nullptr);
 }
 
 NS_IMETHODIMP nsMsgLocalMailFolder::NotifyDelete()
 {
-  NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+  NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
   return NS_OK;
 }
 
 // TODO:  once we move certain code into the IncomingServer (search for TODO)
 // this method will go away.
 // sometimes this gets called when we don't have the server yet, so
 // that's why we're not calling GetServer()
 NS_IMETHODIMP
@@ -3437,19 +3436,17 @@ NS_IMETHODIMP
 nsMsgLocalMailFolder::NotifyCompactCompleted()
 {
   mExpungedBytes = 0;
   m_newMsgs.Clear(); // if compacted, m_newMsgs probably aren't valid.
   // if compacted, processing flags probably also aren't valid.
   ClearProcessingFlags();
   (void) RefreshSizeOnDisk();
   (void) CloseDBIfFolderNotOpen();
-  nsCOMPtr <nsIAtom> compactCompletedAtom;
-  compactCompletedAtom = MsgGetAtom("CompactCompleted");
-  NotifyFolderEvent(compactCompletedAtom);
+  NotifyFolderEvent(kCompactCompleted);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgLocalMailFolder::Shutdown(bool shutdownChildren)
 {
   mInitialized = false;
   return nsMsgDBFolder::Shutdown(shutdownChildren);
 }
--- a/mailnews/local/src/nsLocalUndoTxn.cpp
+++ b/mailnews/local/src/nsLocalUndoTxn.cpp
@@ -14,16 +14,17 @@
 #include "nsIMsgMailSession.h"
 #include "nsIMsgFolderNotificationService.h"
 #include "nsThreadUtils.h"
 #include "nsIMsgDatabase.h"
 #include "nsIMutableArray.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMsgUtils.h"
+#include "nsMsgDBFolder.h"
 
 NS_IMPL_ISUPPORTS_INHERITED(nsLocalMoveCopyMsgTxn, nsMsgTxn, nsIFolderListener)
 
 nsLocalMoveCopyMsgTxn::nsLocalMoveCopyMsgTxn()  : m_srcIsImap4(false),
   m_canUndelete(false)
 {
 }
 
@@ -463,42 +464,42 @@ NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnI
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemRemoved(nsIMsgFolder *parentItem, nsISupports *item)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char *oldValue, const char *newValue)
+NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char *oldValue, const char *newValue)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemIntPropertyChanged(nsIMsgFolder *item, nsIAtom *property, int64_t oldValue, int64_t newValue)
+NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemIntPropertyChanged(nsIMsgFolder *item, const nsACString &property, int64_t oldValue, int64_t newValue)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
+NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemBoolPropertyChanged(nsIMsgFolder *item, const nsACString &property, bool oldValue, bool newValue)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
+NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemUnicharPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue, const char16_t *newValue)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemEvent(nsIMsgFolder *aItem, nsIAtom *aEvent)
+NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemEvent(nsIMsgFolder *aItem, const nsACString &aEvent)
 {
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(nsLocalUndoFolderListener, nsIFolderListener)
 
 nsLocalUndoFolderListener::nsLocalUndoFolderListener(nsLocalMoveCopyMsgTxn *aTxn, nsIMsgFolder *aFolder)
 {
@@ -515,44 +516,42 @@ NS_IMETHODIMP nsLocalUndoFolderListener:
     return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemRemoved(nsIMsgFolder *parentItem, nsISupports *item)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char *oldValue, const char *newValue)
+NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char *oldValue, const char *newValue)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalUndoFolderListener::OnItemIntPropertyChanged(nsIMsgFolder *item, nsIAtom *property, int64_t oldValue, int64_t newValue)
+NS_IMETHODIMP nsLocalUndoFolderListener::OnItemIntPropertyChanged(nsIMsgFolder *item, const nsACString &property, int64_t oldValue, int64_t newValue)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalUndoFolderListener::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
+NS_IMETHODIMP nsLocalUndoFolderListener::OnItemBoolPropertyChanged(nsIMsgFolder *item, const nsACString &property, bool oldValue, bool newValue)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalUndoFolderListener::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
+NS_IMETHODIMP nsLocalUndoFolderListener::OnItemUnicharPropertyChanged(nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue, const char16_t *newValue)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
+NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag, uint32_t newFlag)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP nsLocalUndoFolderListener::OnItemEvent(nsIMsgFolder *aItem, nsIAtom *aEvent)
+NS_IMETHODIMP nsLocalUndoFolderListener::OnItemEvent(nsIMsgFolder *aItem, const nsACString &aEvent)
 {
   if (mTxn && mFolder && aItem == mFolder) {
-      bool isEqual = false;
-      aEvent->ScriptableEquals(NS_LITERAL_STRING("FolderLoaded"), &isEqual);
-      if (isEqual)
+      if (aEvent.Equals(kFolderLoaded))
         return mTxn->UndoTransactionInternal();
   }
 
   return NS_ERROR_FAILURE;
 }
--- a/mailnews/local/src/nsPop3IncomingServer.cpp
+++ b/mailnews/local/src/nsPop3IncomingServer.cpp
@@ -19,16 +19,17 @@
 #include "nsAutoPtr.h"
 #include "nsMsgKeyArray.h"
 #include "nsIMsgLocalMailFolder.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIMutableArray.h"
 #include "nsMsgUtils.h"
+#include "nsMsgDBFolder.h"
 #include "nsComponentManagerUtils.h"
 #include "mozilla/Likely.h"
 
 static NS_DEFINE_CID(kCPop3ServiceCID, NS_POP3SERVICE_CID);
 
 class nsPop3GetMailChainer final : public nsIUrlListener
 {
 public:
@@ -222,21 +223,19 @@ NS_IMETHODIMP nsPop3IncomingServer::SetD
     // use GetRootFolder, because that returns the real
     // root, not the deferred to root.
     rv = GetRootFolder(getter_AddRefs(rootFolder));
     if (rootFolder)
     {
       // if isDeferred state has changed, send notification
       if (aAccountKey.IsEmpty() != deferredToAccount.IsEmpty())
       {
-        nsCOMPtr <nsIAtom> deferAtom = MsgGetAtom("isDeferred");
-        nsCOMPtr <nsIAtom> canFileAtom = MsgGetAtom("CanFileMessages");
-        folderListenerManager->OnItemBoolPropertyChanged(rootFolder, deferAtom,
+        folderListenerManager->OnItemBoolPropertyChanged(rootFolder, kIsDeferred,
                   !deferredToAccount.IsEmpty(), deferredToAccount.IsEmpty());
-        folderListenerManager->OnItemBoolPropertyChanged(rootFolder, canFileAtom,
+        folderListenerManager->OnItemBoolPropertyChanged(rootFolder, kCanFileMessages,
                   deferredToAccount.IsEmpty(), !deferredToAccount.IsEmpty());
 
         // this hack causes the account manager ds to send notifications to the
         // xul content builder that make the changed acct appear or disappear
         // from the folder pane and related menus.
         nsCOMPtr<nsIMsgAccountManager> acctMgr =
                             do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID);
         if (acctMgr)
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -331,17 +331,17 @@ nsMsgNewsFolder::UpdateFolder(nsIMsgWind
       // a folder loaded notification to the front end.
       rv = GetNewMessages(aWindow, nullptr);
     }
     if (rv != NS_MSG_ERROR_OFFLINE)
       return rv;
   }
   // We're not getting messages because either get_messages_on_select is
   // false or we're offline. Send an immediate folder loaded notification.
-  NotifyFolderEvent(mFolderLoadedAtom);
+  NotifyFolderEvent(kFolderLoaded);
   (void) RefreshSizeOnDisk();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgNewsFolder::GetCanSubscribe(bool *aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
@@ -743,17 +743,17 @@ NS_IMETHODIMP nsMsgNewsFolder::GetDeleta
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::RefreshSizeOnDisk()
 {
   uint64_t oldFolderSize = mFolderSize;
   // We set size to unknown to force it to get recalculated from disk.
   mFolderSize = kSizeUnknown;
   if (NS_SUCCEEDED(GetSizeOnDisk(&mFolderSize)))
-    NotifyIntPropertyChanged(kFolderSizeAtom, oldFolderSize, mFolderSize);
+    NotifyIntPropertyChanged(kFolderSize, oldFolderSize, mFolderSize);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetSizeOnDisk(int64_t *size)
 {
   NS_ENSURE_ARG_POINTER(size);
 
   bool isServer = false;
@@ -825,18 +825,18 @@ nsMsgNewsFolder::DeleteMessages(nsIArray
       nsCOMPtr<nsIMsgDBHdr> msgHdr = do_QueryElementAt(messages, i, &rv);
       if (msgHdr)
         rv = mDatabase->DeleteHeader(msgHdr, nullptr, true, true);
     }
     EnableNotifications(allMessageCountNotifications, true);
   }
  
   if (!isMove) 
-    NotifyFolderEvent(NS_SUCCEEDED(rv) ? mDeleteOrMoveMsgCompletedAtom :
-      mDeleteOrMoveMsgFailedAtom);
+    NotifyFolderEvent(NS_SUCCEEDED(rv) ? kDeleteOrMoveMsgCompleted :
+      kDeleteOrMoveMsgFailed);
 
   (void) RefreshSizeOnDisk();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::CancelMessage(nsIMsgDBHdr *msgHdr,
                                              nsIMsgWindow *aMsgWindow)
@@ -1560,23 +1560,23 @@ NS_IMETHODIMP nsMsgNewsFolder::RemoveMes
     notifier->NotifyMsgsDeleted(msgHdrs);
   }
 
   return mDatabase->DeleteMessages(aMsgKeys.Length(), aMsgKeys.Elements(), nullptr);
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::CancelComplete()
 {
-  NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
+  NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::CancelFailed()
 {
-  NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
+  NotifyFolderEvent(kDeleteOrMoveMsgFailed);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetSaveArticleOffline(bool *aBool)
 {
   NS_ENSURE_ARG(aBool);
   *aBool = m_downloadMessageForOfflineUse;
   return NS_OK;
@@ -1747,22 +1747,19 @@ NS_IMETHODIMP nsMsgNewsFolder::GetMessag
   rv = hdr->GetMessageId(getter_Copies(id));
   result.Assign(id);
   return rv;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::SetSortOrder(int32_t order)
 {
   int32_t oldOrder = mSortOrder;
-  
-  mSortOrder = order;
-  nsCOMPtr<nsIAtom> sortOrderAtom = MsgGetAtom("SortOrder");
-  // What to do if the atom can't be allocated?
-  NotifyIntPropertyChanged(sortOrderAtom, oldOrder, order);
-  
+
+  NotifyIntPropertyChanged(kSortOrder, oldOrder, order);
+
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetSortOrder(int32_t *order)
 {
   NS_ENSURE_ARG_POINTER(order);
   *order = mSortOrder;
   return NS_OK;
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -100,20 +100,16 @@ nsNntpIncomingServer::nsNntpIncomingServ
   mVersion = INVALID_VERSION;
 
   mLastGroupDate = 0;
   mUniqueId = 0;
   mHasSeenBeginGroups = false;
   mPostingAllowed = false;
   mLastUpdatedTime = 0;
 
-  // these atoms are used for subscribe search
-  mSubscribedAtom = MsgGetAtom("subscribed");
-  mNntpAtom = MsgGetAtom("nntp");
-
   // we have server wide and per group filters
   m_canHaveFilters = true;
 
   SetupNewsrcSaveTimer();
 }
 
 nsNntpIncomingServer::~nsNntpIncomingServer()
 {
--- a/mailnews/news/src/nsNntpIncomingServer.h
+++ b/mailnews/news/src/nsNntpIncomingServer.h
@@ -17,17 +17,16 @@
 #include "prprf.h"
 
 #include "nsIMsgWindow.h"
 #include "nsISubscribableServer.h"
 #include "nsITimer.h"
 #include "nsIFile.h"
 #include "nsITreeView.h"
 #include "nsITreeSelection.h"
-#include "nsIAtom.h"
 #include "nsCOMArray.h"
 
 #include "nsNntpMockChannel.h"
 #include "nsAutoPtr.h"
 
 class nsINntpUrl;
 class nsIMsgMailNewsUrl;
 
@@ -101,18 +100,16 @@ private:
     nsTArray<nsCString> mGroupsOnServer;
     nsTArray<nsCString> mSubscribeSearchResult;
     bool mSearchResultSortDescending;
     // the list of of subscribed newsgroups within a given
     // subscribed dialog session.  
     // we need to keep track of them so we know what to show as "checked"
     // in the search view
     nsTArray<nsCString> mTempSubscribed;
-    nsCOMPtr<nsIAtom> mSubscribedAtom;
-    nsCOMPtr<nsIAtom> mNntpAtom;
 
     nsCOMPtr<nsITreeBoxObject> mTree;
     nsCOMPtr<nsITreeSelection> mTreeSelection;
 
     bool     mHasSeenBeginGroups;
     bool     mGetOnlyNew;
     nsresult WriteHostInfoFile();
     nsresult LoadHostInfoFile();