Bug 1498041 - Turn on ESLint in mail/base/content: fix undefined variable in mailnews; r=aceman
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 23 Nov 2018 22:35:28 +1300
changeset 33772 ea243e192c5f11b0bf49ade0a04878807a060d9d
parent 33771 f91bceb3c9f70c4a8a44c9dfc5ce54d87ba2bc04
child 33773 34934d017e6068cd99126d83363c4559d72f1233
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersaceman
bugs1498041
Bug 1498041 - Turn on ESLint in mail/base/content: fix undefined variable in mailnews; r=aceman
mailnews/base/content/junkCommands.js
--- a/mailnews/base/content/junkCommands.js
+++ b/mailnews/base/content/junkCommands.js
@@ -281,17 +281,17 @@ function analyzeMessagesForJunk() { proc
  */
 function processFolderForJunk(aAll)
 {
   MsgJunkMailInfo(true);
 
   if (aAll)
   {
     // need to expand all threads, so we analyze everything
-    gDBView.doCommand(nsMsgViewCommandType.expandAll);
+    gDBView.doCommand(Ci.nsMsgViewCommandType.expandAll);
     var treeView = gDBView.QueryInterface(Ci.nsITreeView);
     var count = treeView.rowCount;
     if (!count)
       return;
   }
   else
   {
     // suite uses GetSelectedIndices, mail uses gFolderDisplay.selectedMessages
@@ -356,18 +356,18 @@ function JunkSelectedMessages(setAsJunk)
   // too. This is independent of the "markAsReadOnSpam" pref, which applies
   // only to automatically-classified messages.
   // Note that this behaviour should match the one in the back end for marking
   // as junk via clicking the 'junk' column.
 
   if (setAsJunk && Services.prefs.getBoolPref("mailnews.ui.junk.manualMarkAsJunkMarksRead"))
     MarkSelectedMessagesRead(true);
 
-  gDBView.doCommand(setAsJunk ? nsMsgViewCommandType.junk
-                              : nsMsgViewCommandType.unjunk);
+  gDBView.doCommand(setAsJunk ? Ci.nsMsgViewCommandType.junk
+                              : Ci.nsMsgViewCommandType.unjunk);
 }
 
 /**
  * Delete junk messages in the current folder. This provides the guarantee that
  * the method will be synchronous if no messages are deleted.
  *
  * @returns The number of messages deleted.
  */
@@ -393,17 +393,17 @@ function deleteJunkInFolder()
     if (junkMsgHdrs.length)
       gDBView.msgFolder.deleteMessages(junkMsgHdrs, msgWindow, false, false, null, true);
     return junkMsgHdrs.length;
   }
 
   // Folder is virtual, let the view do the work (but we lose selection)
 
   // need to expand all threads, so we find everything
-  gDBView.doCommand(nsMsgViewCommandType.expandAll);
+  gDBView.doCommand(Ci.nsMsgViewCommandType.expandAll);
 
   var treeView = gDBView.QueryInterface(Ci.nsITreeView);
   var count = treeView.rowCount;
   if (!count)
     return 0;
 
   var treeSelection = treeView.selection;
 
@@ -443,14 +443,14 @@ function deleteJunkInFolder()
   if (!clearedSelection)
     return 0;
 
   treeSelection.selectEventsSuppressed = false;
   // delete the selected messages
   //
   // We'll leave no selection after the delete
   gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
-  gDBView.doCommand(nsMsgViewCommandType.deleteMsg);
+  gDBView.doCommand(Ci.nsMsgViewCommandType.deleteMsg);
   treeSelection.clearSelection();
   ClearMessagePane();
   return numMessagesDeleted;
 }