Bug 375717 - Only show newly received messages in notification. r=mkmelin a=wsmwk
authorPing Chen <remotenonsense@gmail.com>
Mon, 22 Feb 2021 16:46:51 +0900
changeset 41370 98ca31631af56a0e3a28290f5c6376ce417b9dd0
parent 41369 ad4d383ac29bee4fcddbed07ebea9b1460424bf0
child 41371 12e82e54da9e609eddfe0c83cfd0c296a3375ec8
push id2989
push userthunderbird@calypsoblue.org
push dateMon, 01 Mar 2021 19:24:13 +0000
treeherdercomm-beta@c96075bebc30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, wsmwk
bugs375717
Bug 375717 - Only show newly received messages in notification. r=mkmelin a=wsmwk
mail/base/content/foldersummary.js
--- a/mail/base/content/foldersummary.js
+++ b/mail/base/content/foldersummary.js
@@ -132,16 +132,21 @@
           // The database for this folder may be missing (e.g. outdated/missing .msf),
           // then just skip this folder.
           continue;
         }
 
         folder.msgDatabase = null;
         let msgKeys = msgDatabase.getNewList();
 
+        // NOTE: getNewlist returns all nsMsgMessageFlagType::New messages,
+        // while getNumNewMessages returns count of new messages since the last
+        // biff. Only show newly received messages since last biff in
+        // notification.
+        msgKeys = msgKeys.slice(-folder.getNumNewMessages(false));
         if (!msgKeys.length) {
           continue;
         }
 
         if (this.showPreview) {
           // fetchMsgPreviewText forces the previewText property to get generated
           // for each of the message keys.
           try {