Bug 453908 - rename GetOrCreateFolder() to GetOrCreateJunkFolder(). r=aceman
authorBen Campbell <benc@thunderbird.net>
Mon, 21 Jan 2019 12:17:06 +1300
changeset 33433 5d2d5584e944
parent 33432 d156755548d3
child 33434 0b1d7c60056b
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs453908
Bug 453908 - rename GetOrCreateFolder() to GetOrCreateJunkFolder(). r=aceman Old name is overly-general for what is a very specific function.
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsLocalMailFolder.cpp
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -4143,22 +4143,22 @@ nsMsgDBView::DetermineActionsForJunkChan
     {
       rv = GetExistingFolder(spamFolderURI, targetFolder);
       if (NS_SUCCEEDED(rv) && *targetFolder)
       {
         moveMessages = true;
       }
       else
       {
-        // XXX ToDo: GetOrCreateFolder will only create a folder with localized
+        // XXX ToDo: GetOrCreateJunkFolder will only create a folder with localized
         //           name "Junk" regardless of spamFolderURI. So if someone
         //           sets the junk folder to an existing folder of a different
         //           name, then deletes that folder, this will fail to create
         //           the correct folder.
-        rv = GetOrCreateFolder(spamFolderURI, nullptr /* aListener */);
+        rv = GetOrCreateJunkFolder(spamFolderURI, nullptr /* aListener */);
         if (NS_SUCCEEDED(rv))
           rv = GetExistingFolder(spamFolderURI, targetFolder);
 
         NS_ASSERTION(NS_SUCCEEDED(rv) && *targetFolder, "GetOrCreateFolder failed");
       }
     }
 
     return NS_OK;
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -441,17 +441,17 @@ nsresult nsSpamSettings::UpdateJunkFolde
 
   mCurrentJunkFolderURI = newJunkFolderURI;
 
   // only try to create the junk folder if we are moving junk
   // and we have a non-empty uri
   if (mMoveOnSpam && !mCurrentJunkFolderURI.IsEmpty()) {
     // as the url listener, the spam settings will set the nsMsgFolderFlags::Junk folder flag
     // on the junk mail folder, after it is created
-    rv = GetOrCreateFolder(mCurrentJunkFolderURI, this);
+    rv = GetOrCreateJunkFolder(mCurrentJunkFolderURI, this);
   }
 
   return rv;
 }
 
 NS_IMETHODIMP nsSpamSettings::Clone(nsISpamSettings *aSpamSettings)
 {
   NS_ENSURE_ARG_POINTER(aSpamSettings);
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -834,17 +834,17 @@ nsresult IsRFC822HeaderFieldName(const c
     }
   }
   *aResult = true;
   return NS_OK;
 }
 
 // Warning, currently this routine only works for the Junk Folder
 nsresult
-GetOrCreateFolder(const nsACString &aURI, nsIUrlListener *aListener)
+GetOrCreateJunkFolder(const nsACString &aURI, nsIUrlListener *aListener)
 {
   nsresult rv;
   nsCOMPtr <nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // get the corresponding RDF resource
   // RDF will create the folder resource if it doesn't already exist
   nsCOMPtr<nsIRDFResource> resource;
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -139,17 +139,17 @@ NS_MSG_BASE nsresult NS_GetLocalizedUnic
 NS_MSG_BASE nsresult NS_GetLocalizedUnicharPreference(nsIPrefBranch *prefBranch,   //can be null, if so uses the root branch
                                                       const char *prefName,
                                                       nsAString& prefValue);
 
   /**
    * this needs a listener, because we might have to create the folder
    * on the server, and that is asynchronous
    */
-NS_MSG_BASE nsresult GetOrCreateFolder(const nsACString & aURI, nsIUrlListener *aListener);
+NS_MSG_BASE nsresult GetOrCreateJunkFolder(const nsACString & aURI, nsIUrlListener *aListener);
 
 // Returns true if the nsIURI is a message under an RSS account
 NS_MSG_BASE nsresult IsRSSArticle(nsIURI * aMsgURI, bool *aIsRSSArticle);
 
 // digest needs to be a pointer to a 16 byte buffer
 #define DIGEST_LENGTH 16
 
 NS_MSG_BASE nsresult MSGCramMD5(const char *text, int32_t text_len, const char *key, int32_t key_len, unsigned char *digest);
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -9168,18 +9168,18 @@ nsImapMailFolder::OnMessageClassified(co
                 // JUNK MAIL RELATED
                 // the listener should do
                 // rv = folder->SetFlag(nsMsgFolderFlags::Junk);
                 // NS_ENSURE_SUCCESS(rv,rv);
                 // if (NS_SUCCEEDED(GetMoveCoalescer())) {
                 //   m_moveCoalescer->AddMove(folder, msgKey);
                 //   willMoveMessage = true;
                 // }
-                rv = GetOrCreateFolder(spamFolderURI, nullptr /* aListener */);
-                NS_ASSERTION(NS_SUCCEEDED(rv), "GetOrCreateFolder failed");
+                rv = GetOrCreateJunkFolder(spamFolderURI, nullptr /* aListener */);
+                NS_ASSERTION(NS_SUCCEEDED(rv), "GetOrCreateJunkFolder failed");
               }
             }
           }
         }
         rv = spamSettings->LogJunkHit(msgHdr, willMoveMessage);
         NS_ENSURE_SUCCESS(rv,rv);
       }
     }
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -3457,18 +3457,18 @@ nsMsgLocalMailFolder::OnMessageClassifie
             {
               // XXX TODO
               // JUNK MAIL RELATED
               // the listener should do
               // rv = folder->SetFlag(nsMsgFolderFlags::Junk);
               // NS_ENSURE_SUCCESS(rv,rv);
               // mSpamKeysToMove.AppendElement(msgKey);
               // willMoveMessage = true;
-              rv = GetOrCreateFolder(spamFolderURI, nullptr /* aListener */);
-              NS_ASSERTION(NS_SUCCEEDED(rv), "GetOrCreateFolder failed");
+              rv = GetOrCreateJunkFolder(spamFolderURI, nullptr /* aListener */);
+              NS_ASSERTION(NS_SUCCEEDED(rv), "GetOrCreateJunkFolder failed");
             }
           }
         }
         rv = spamSettings->LogJunkHit(msgHdr, willMoveMessage);
         NS_ENSURE_SUCCESS(rv,rv);
       }
     }
   }