Bug 1025976 - Remove GotNew folder flag. r=aceman
authorbstefan <bogdan.stefan3@gmail.com>
Sat, 26 Mar 2016 04:29:00 +0100
changeset 24704 d9df380b42b0786499f96ace95c64a53e5444389
parent 24703 e2845f0b82eb5e02a580d3d29e57dd84e36c21c2
child 24705 392597c446e250faf9faa50838320c155078c315
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1025976
Bug 1025976 - Remove GotNew folder flag. r=aceman
mailnews/base/public/nsMsgFolderFlags.idl
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/test/unit/test_imapFilterActions.js
mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
mailnews/local/src/nsParseMailbox.cpp
--- a/mailnews/base/public/nsMsgFolderFlags.idl
+++ b/mailnews/base/public/nsMsgFolderFlags.idl
@@ -6,17 +6,17 @@
 // This must be limited to unsigned long (uint32_t, no uint64_t)
 // as long as nsIMsgFolder exposes the 'flags' property which contains
 // all the flags values. The callers are used to do
 // (folder.flags & nsMsgFolderFlags.<flagname>) in Javascript
 // which cuts the value to 32bit only. See bug 813459.
 typedef unsigned long nsMsgFolderFlagType;
 
 /// Flags about a folder or a newsgroup.
-[scriptable,uuid(fbe7cba8-3141-4c44-9660-99af6b53f27e)]
+[scriptable,uuid(440cd0fc-b4b3-4a0f-a492-92fbe7920588)]
 interface nsMsgFolderFlags {
   /**
    * @name Folder Type Flags
    * These flags define the type of folder. Exactly one will be set.
    * @{
    */
   /// This folder is a newsgroup folder.
   const nsMsgFolderFlagType Newsgroup       = 0x00000001;
@@ -72,18 +72,18 @@ interface nsMsgFolderFlags {
   /// Whether this folder on online IMAP
   const nsMsgFolderFlagType ImapBox         = 0x00002000;
   /// Whether this is an archive folder
   const nsMsgFolderFlagType Archive         = 0x00004000;
   /// This used to be used for virtual newsgroups
   const nsMsgFolderFlagType Unused1         = 0x00008000;
   /// Used to be for categories
   const nsMsgFolderFlagType Unused4         = 0x00010000;
-  /// This folder got new msgs
-  const nsMsgFolderFlagType GotNew          = 0x00020000;
+  /// Used to be for new msgs in a folder
+  const nsMsgFolderFlagType Unused7         = 0x00020000;
   /// Used to be for a folder that is an IMAP server (ImapServer)
   const nsMsgFolderFlagType Unused6         = 0x00040000;
   /// This folder is an IMAP personal folder
   const nsMsgFolderFlagType ImapPersonal    = 0x00080000;
   /// This folder is an IMAP public folder
   const nsMsgFolderFlagType ImapPublic      = 0x00100000;
   /// This folder is another user's IMAP folder.  Think of it like a folder that someone would share.
   const nsMsgFolderFlagType ImapOtherUser   = 0x00200000;
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -682,18 +682,16 @@ nsresult nsMsgDBFolder::ReadDBFolderInfo
         folderInfo->GetCharacterSet(mCharset);
         folderInfo->GetCharacterSetOverride(&mCharsetOverride);
 
         if (db) {
           bool hasnew;
           nsresult rv;
           rv = db->HasNew(&hasnew);
           if (NS_FAILED(rv)) return rv;
-          if (!hasnew && mNumPendingUnreadMessages <= 0)
-            ClearFlag(nsMsgFolderFlags::GotNew);
         }
       }
     }
     else {
       // we tried to open DB but failed - don't keep trying.
       // If a DB is created, we will call this method with force == TRUE,
       // and read from the db that way.
       mInitializedFromCache = true;
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -4181,18 +4181,16 @@ nsresult nsImapMailFolder::MoveIncorpora
         // keep track of nsIMsgFolder, nsTArray<nsMsgKey> pairs here in the imap code.
         // nsTArray<nsMsgKey> *idsToMoveFromInbox = msgFolder->GetImapIdsToMoveFromInbox();
         // idsToMoveFromInbox->AppendElement(keyToFilter);
         if (imapDeleteIsMoveToTrash)
         {
         }
         bool isRead = false;
         mailHdr->GetIsRead(&isRead);
-        if (!isRead)
-          destIFolder->SetFlag(nsMsgFolderFlags::GotNew);
         if (imapDeleteIsMoveToTrash)
           rv = NS_OK;
       }
     }
   }
 
   // we have to return an error because we do not actually move the message
   // it is done async and that can fail
--- a/mailnews/imap/test/unit/test_imapFilterActions.js
+++ b/mailnews/imap/test/unit/test_imapFilterActions.js
@@ -584,21 +584,19 @@ function testCounts(aHasNew, aUnreadDelt
   try {
   let folderNew = IMAPPump.inbox.getNumNewMessages(false);
   let hasNew = IMAPPump.inbox.hasNewMessages;
   let unread = IMAPPump.inbox.getNumUnread(false);
   let countOut = {};
   let arrayOut = {};
   db().getNewList(countOut, arrayOut);
   let dbNew = countOut.value ? countOut.value : 0;
-  let folderNewFlag = IMAPPump.inbox.getFlag(Ci.nsMsgFolderFlags.GotNew);
   dump(" hasNew: " + hasNew +
        " unread: " + unread +
        " folderNew: " + folderNew +
-       " folderNewFlag: " + folderNewFlag +
        " dbNew: " + dbNew +
        " prevUnread " + gPreviousUnread +
        "\n");
   Assert.equal(aHasNew, hasNew);
   Assert.equal(aUnreadDelta, unread - gPreviousUnread);
   gPreviousUnread = unread;
   // This seems to be reset for each folder update.
   //
--- a/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
+++ b/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
@@ -409,21 +409,19 @@ function testCounts(aHasNew, aUnreadDelt
   try {
   let folderNew = IMAPPump.inbox.getNumNewMessages(false);
   let hasNew = IMAPPump.inbox.hasNewMessages;
   let unread = IMAPPump.inbox.getNumUnread(false);
   let countOut = {};
   let arrayOut = {};
   db().getNewList(countOut, arrayOut);
   let dbNew = countOut.value ? countOut.value : 0;
-  let folderNewFlag = IMAPPump.inbox.getFlag(Ci.nsMsgFolderFlags.GotNew);
   dump(" hasNew: " + hasNew +
        " unread: " + unread +
        " folderNew: " + folderNew +
-       " folderNewFlag: " + folderNewFlag +
        " dbNew: " + dbNew +
        " prevUnread " + gPreviousUnread +
        "\n");
   //Assert.equal(aHasNew, hasNew);
   Assert.equal(aUnreadDelta, unread - gPreviousUnread);
   gPreviousUnread = unread;
   // This seems to be reset for each folder update.
   //
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -2601,17 +2601,16 @@ nsresult nsParseNewMailState::MoveIncorp
   if (movedMsgIsNew)
     destIFolder->SetHasNewMessages(true);
   if (!m_filterTargetFolders.Contains(destIFolder))
     m_filterTargetFolders.AppendObject(destIFolder);
 
   destIFolder->ReleaseSemaphore (myISupports);
 
   (void) localFolder->RefreshSizeOnDisk();
-  destIFolder->SetFlag(nsMsgFolderFlags::GotNew);
 
   // Notify the message was moved.
   if (notifier) {
     nsCOMPtr<nsIMsgFolder> folder;
     nsresult rv = mailHdr->GetFolder(getter_AddRefs(folder));
     if (NS_SUCCEEDED(rv)) {
       notifier->NotifyItemEvent(folder,
                                 NS_LITERAL_CSTRING("UnincorporatedMessageMoved"),