Bug 1334834 - remove use of nsIAtom from mailnews/nsIFolder*.idl, JS part. r=aceman
authorJorg K <jorgk@jorgk.com>
Sun, 27 Aug 2017 13:57:53 +0200
changeset 29631 9df74592471ab94f262e59b2de5394202b4e74d4
parent 29630 93d7402586ec2b1f30de938083d5cdb10d0b3741
child 29632 6d35f2d9bf66d6a7a8c5ec862424911199d3774f
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, JS part. r=aceman
mail/base/content/msgMail3PaneWindow.js
mail/base/modules/dbViewWrapper.js
mail/test/mozmill/shared-modules/test-folder-display-helpers.js
mailnews/base/content/folderWidgets.xml
mailnews/base/search/content/FilterEditor.js
mailnews/db/gloda/modules/index_msg.js
mailnews/imap/test/unit/test_imapFilterActions.js
mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
mailnews/imap/test/unit/test_imapHdrChunking.js
mailnews/news/test/unit/test_bug695309.js
mailnews/news/test/unit/test_internalUris.js
mailnews/test/resources/folderEventLogHelper.js
mailnews/test/resources/mailTestUtils.js
suite/mailnews/messageWindow.js
suite/mailnews/msgMail3PaneWindow.js
suite/mailnews/search/SearchDialog.js
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -63,30 +63,29 @@ var folderListener = {
     OnItemAdded: function(parentItem, item) { },
 
     OnItemRemoved: function(parentItem, item) { },
 
     OnItemPropertyChanged: function(item, property, oldValue, newValue) { },
 
     OnItemIntPropertyChanged: function(item, property, oldValue, newValue) {
       if (item == gFolderDisplay.displayedFolder) {
-        if(property.toString() == "TotalMessages" || property.toString() == "TotalUnreadMessages") {
+        if(property == "TotalMessages" || property == "TotalUnreadMessages") {
           UpdateStatusMessageCounts(gFolderDisplay.displayedFolder);
         }
       }
     },
 
     OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) { },
 
     OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue) { },
     OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) { },
 
     OnItemEvent: function(folder, event) {
-      var eventType = event.toString();
-      if (eventType == "ImapHdrDownloaded") {
+      if (event == "ImapHdrDownloaded") {
         if (folder) {
           var imapFolder = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
           if (imapFolder) {
             var hdrParser = imapFolder.hdrParser;
             if (hdrParser) {
               var msgHdr = hdrParser.GetNewMsgHdr();
               if (msgHdr)
               {
@@ -98,17 +97,17 @@ var folderListener = {
                 if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
                   msgHdr.setStringProperty("imageSize", "1");
                 }
               }
             }
           }
         }
       }
-      else if (eventType == "JunkStatusChanged") {
+      else if (event == "JunkStatusChanged") {
         HandleJunkStatusChanged(folder);
       }
     }
 }
 
 function ServerContainsFolder(server, folder)
 {
   if (!folder || !server)
--- a/mail/base/modules/dbViewWrapper.js
+++ b/mail/base/modules/dbViewWrapper.js
@@ -194,18 +194,17 @@ var FolderNotificationHelper = {
       }
     }
     for (let wrapper of this._curiousWrappers)
       wrapper[aHandlerName](aFolder);
   },
 
   OnItemEvent: function FolderNotificationHelper_OnItemEvent(
       aFolder, aEvent) {
-    let eventType = aEvent.toString();
-    if (eventType == "FolderLoaded") {
+    if (aEvent == "FolderLoaded") {
       let folderURI = aFolder.URI;
       let widgets = this._pendingFolderUriToViewWrapperLists[folderURI];
       if (widgets) {
         for (let widget of widgets) {
           // we are friends, this is an explicit relationship.
           // (we don't use a generic callback mechanism because the 'this' stuff
           //  gets ugly and no one else should be hooking in at this level.)
           try {
@@ -217,38 +216,36 @@ var FolderNotificationHelper = {
             if (ex.stack)
               dump("STACK: " + ex.stack + "\n");
             Cu.reportError(ex);
           }
         }
         delete this._pendingFolderUriToViewWrapperLists[folderURI];
       }
     }
-    else if (eventType == "AboutToCompact") {
+    else if (aEvent == "AboutToCompact") {
       this._notifyHelper(aFolder, "_aboutToCompactFolder");
     }
-    else if (eventType == "CompactCompleted") {
+    else if (aEvent == "CompactCompleted") {
       this._notifyHelper(aFolder, "_compactedFolder");
     }
-    else if (eventType == "DeleteOrMoveMsgCompleted") {
+    else if (aEvent == "DeleteOrMoveMsgCompleted") {
       this._notifyHelper(aFolder, "_deleteCompleted");
     }
-    else if (eventType == "DeleteOrMoveMsgFailed") {
+    else if (aEvent == "DeleteOrMoveMsgFailed") {
       this._notifyHelper(aFolder, "_deleteFailed");
     }
-    else if (eventType == "RenameCompleted") {
+    else if (aEvent == "RenameCompleted") {
       this._notifyHelper(aFolder, "_renameCompleted");
     }
-
   },
 
   OnItemIntPropertyChanged: function(aFolder, aProperty, aOldValue, aNewValue) {
-    let propertyString = aProperty.toString();
-    if ((propertyString == "TotalMessages") ||
-        (propertyString == "TotalUnreadMessages"))
+    if ((aProperty == "TotalMessages") ||
+        (aProperty == "TotalUnreadMessages"))
       this._notifyHelper(aFolder, "_messageCountsChanged");
   },
 
   _folderMoveHelper: function(aOldFolder, aNewFolder) {
     let oldURI = aOldFolder.URI;
     let newURI = aNewFolder.URI;
     // fix up our listener tables.
     if (oldURI in this._pendingFolderUriToViewWrapperLists) {
--- a/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
@@ -1722,17 +1722,17 @@ var FolderListener = {
       }
     }
   },
 
   OnItemEvent: function FolderNotificationHelper_OnItemEvent(
       aFolder, aEvent) {
     if (!this.watchingFor)
       return;
-    if (this.watchingFor.includes(aEvent.toString())) {
+    if (this.watchingFor.includes(aEvent)) {
       this.watchingFor = null;
       this.sawEvents = true;
     }
   },
 };
 
 /**
  * Plan to wait for an nsIFolderListener.OnItemEvent matching one of the
--- a/mailnews/base/content/folderWidgets.xml
+++ b/mailnews/base/content/folderWidgets.xml
@@ -242,28 +242,28 @@
         },
         OnItemUnicharPropertyChanged: function(aItem, aProperty, aOld, aNew) {
           var child = this._getChildForItem(aItem);
           if (child)
             this._menu._setCssSelectors(child._folder, child);
         },
         OnItemPropertyFlagChanged: function(aItem, aProperty, aOld, aNew) {},
         OnItemEvent: function(aFolder, aEvent) {
-          if (aEvent.toString() == "MRMTimeChanged") {
+          if (aEvent == "MRMTimeChanged") {
             if (this._menu.getAttribute("showRecent") != "true" ||
                 !this._menu.firstChild || !this._menu.firstChild.firstChild)
               return;
             // if this folder is already in the recent menu, return.
             if (this._getChildForItem(aFolder,
                                       this._menu.firstChild.firstChild))
               return;
           }
           // Special casing folder renames here, since they require more work
           // since sort-order may have changed.
-          else if (aEvent.toString() == "RenameCompleted") {
+          else if (aEvent == "RenameCompleted") {
             if (!this._getChildForItem(aFolder))
               return;
           }
           else
             return;
           // folder renamed, or new recent folder, so rebuild.
           setTimeout(this._clearMenu, 0, this._menu);
         },
--- a/mailnews/base/search/content/FilterEditor.js
+++ b/mailnews/base/search/content/FilterEditor.js
@@ -227,24 +227,22 @@ var gFolderListener = {
 
   OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {},
 
   OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue){},
   OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {},
 
   OnItemEvent: function(folder, event)
   {
-    var eventType = event.toString();
-
-    if (eventType == "FolderCreateCompleted")
+    if (event == "FolderCreateCompleted")
     {
       gActionTargetElement.selectFolder(folder);
       SetBusyCursor(window, false);
     }
-    else if (eventType == "FolderCreateFailed")
+    else if (event == "FolderCreateFailed")
       SetBusyCursor(window, false);
   }
 }
 
 function duplicateFilterNameExists(filterName)
 {
   if (gFilterList)
     for (var i = 0; i < gFilterList.filterCount; i++)
--- a/mailnews/db/gloda/modules/index_msg.js
+++ b/mailnews/db/gloda/modules/index_msg.js
@@ -2774,17 +2774,17 @@ var GlodaMsgIndexer = {
     },
     /**
      * Detect changes to folder flags and reset our indexing priority.  This
      * is important because (all?) folders start out without any flags and
      * then get their flags added to them.
      */
     OnItemIntPropertyChanged: function gloda_indexer_OnItemIntPropertyChanged(
                                 aFolderItem, aProperty, aOldValue, aNewValue) {
-      if (aProperty.toString() !== "FolderFlag")
+      if (aProperty !== "FolderFlag")
         return;
       if (!GlodaMsgIndexer.shouldIndexFolder(aFolderItem))
         return;
       // Only reset priority if folder Special Use changes.
       if ((aOldValue & Ci.nsMsgFolderFlags.SpecialUse) ==
           (aNewValue & Ci.nsMsgFolderFlags.SpecialUse))
         return;
       GlodaMsgIndexer.resetFolderIndexingPriority(aFolderItem);
@@ -2798,35 +2798,34 @@ var GlodaMsgIndexer = {
 
     },
     /**
      * Notice when user activity adds/removes tags or changes a message's
      *  status.
      */
     OnItemPropertyFlagChanged: function gloda_indexer_OnItemPropertyFlagChanged(
                                 aMsgHdr, aProperty, aOldValue, aNewValue) {
-      let propertyString = aProperty.toString();
-      if (propertyString == "Keywords" ||
+      if (aProperty == "Keywords" ||
           // We could care less about the new flag changing.
-          (propertyString == "Status" &&
+          (aProperty == "Status" &&
            (aOldValue ^ aNewValue) != nsMsgMessageFlags.New &&
            // We do care about IMAP deletion, but msgsDeleted tells us that, so
            //  ignore IMAPDeleted too...
            (aOldValue ^ aNewValue) != nsMsgMessageFlags.IMAPDeleted) ||
-          propertyString == "Flagged") {
+          aProperty == "Flagged") {
         GlodaMsgIndexer._reindexChangedMessages([aMsgHdr], true);
       }
     },
 
     /**
      * Get folder loaded notifications for folders that had to do some
      *  (asynchronous) processing before they could be opened.
      */
     OnItemEvent: function gloda_indexer_OnItemEvent(aFolder, aEvent) {
-      if (aEvent.toString() == "FolderLoaded")
+      if (aEvent == "FolderLoaded")
         this.indexer._onFolderLoaded(aFolder);
     },
   },
 
   /* ***** Rebuilding / Reindexing ***** */
   /**
    * Allow us to invalidate an outstanding folder traversal because the
    *  underlying database is going away.  We use other means for detecting
--- a/mailnews/imap/test/unit/test_imapFilterActions.js
+++ b/mailnews/imap/test/unit/test_imapFilterActions.js
@@ -430,17 +430,17 @@ function endTest()
 
 /*
  * listener objects
  */
 
 // nsIFolderListener implementation
 var FolderListener = {
   OnItemEvent: function OnItemEvent(aEventFolder, aEvent) {
-    dump("received folder event " + aEvent.toString() +
+    dump("received folder event " + aEvent +
          " folder " + aEventFolder.name +
          "\n");
   }
 };
 
 // nsIDBChangeListener implementation. Counts of calls are kept, but not
 // currently used in the tests. Current role is to provide a reference
 // to the new message header (plus give some examples of using db listeners
--- a/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
+++ b/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
@@ -257,17 +257,17 @@ function endTest()
 
 /*
  * listener objects
  */
 
 // nsIFolderListener implementation
 var FolderListener = {
   OnItemEvent: function OnItemEvent(aEventFolder, aEvent) {
-    dump("received folder event " + aEvent.toString() +
+    dump("received folder event " + aEvent +
          " folder " + aEventFolder.name +
          "\n");
   }
 };
 
 // nsIDBChangeListener implementation. Counts of calls are kept, but not
 // currently used in the tests. Current role is to provide a reference
 // to the new message header (plus give some examples of using db listeners
--- a/mailnews/imap/test/unit/test_imapHdrChunking.js
+++ b/mailnews/imap/test/unit/test_imapHdrChunking.js
@@ -24,17 +24,17 @@ var dummyMsgWindow =
   openFolder : IMAPPump.inbox,
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIMsgWindow,
                                          Ci.nsISupportsWeakReference])
 };
 
 var gFolderListener = {
   _gotNewMailBiff: false,
   OnItemIntPropertyChanged : function(aItem, aProperty, aOldValue, aNewValue) {
-    if (aProperty.toString() == "BiffState" &&
+    if (aProperty == "BiffState" &&
         aNewValue == Ci.nsIMsgFolder.nsMsgBiffState_NewMail) {
       this._gotNewMailBiff = true;
       async_driver();
     }
   }
 };
 
 var tests = [
--- a/mailnews/news/test/unit/test_bug695309.js
+++ b/mailnews/news/test/unit/test_bug695309.js
@@ -61,21 +61,21 @@ function* trigger_bug() {
   // present, be overwritten with one from the load queue that causes the
   // confusion. It then loads it again, and should (before the patch that fixes
   // this) read the 200 logon instead of the 211 group.
   let folder = localserver.rootFolder.getChildNamed("test.filter");
   localserver.performExpand(null);
   // We also need a callback to know that folders have been loaded.
   let folderListener = {
     OnItemEvent: function (item, event) {
-      dump(event.toString() + " triggered for " + item.prettyName + "!\n\n\n");
-      if (event.toString() == "FolderLoaded" &&
+      dump(event + " triggered for " + item.prettyName + "!\n\n\n");
+      if (event == "FolderLoaded" &&
           item.prettyName == "test.subscribe.simple") {
         folder.getNewMessages(null, asyncUrlListener);
-      } else if (event.toString() == "FolderLoaded" && item == folder) {
+      } else if (event == "FolderLoaded" && item == folder) {
         async_driver();
       }
     },
     QueryInterface: XPCOMUtils.generateQI([Ci.nsIFolderListener])
   };
   MailServices.mailSession.AddFolderListener(folderListener, Ci.nsIFolderListener.event);
   // Again, two things will need to be listened for
   yield false;
--- a/mailnews/news/test/unit/test_internalUris.js
+++ b/mailnews/news/test/unit/test_internalUris.js
@@ -55,17 +55,17 @@ function confirmEx(title, text, flags) {
 function* test_cancel() {
   // This tests nsMsgNewsFolder::CancelMessage
   let folder = localserver.rootFolder.getChildNamed("test.filter");
   let db = folder.msgDatabase;
   let hdr = db.GetMsgHdrForKey(4);
 
   let folderListener = {
     OnItemEvent: function(aEventFolder, aEvent) {
-      if (aEvent.toString() == "DeleteOrMoveMsgCompleted") {
+      if (aEvent == "DeleteOrMoveMsgCompleted") {
         MailServices.mailSession.RemoveFolderListener(this);
       }
     }
   };
   MailServices.mailSession.AddFolderListener(folderListener, Ci.nsIFolderListener.event);
   folder.QueryInterface(Ci.nsIMsgNewsFolder)
         .cancelMessage(hdr, dummyMsgWindow);
   yield false;
--- a/mailnews/test/resources/folderEventLogHelper.js
+++ b/mailnews/test/resources/folderEventLogHelper.js
@@ -135,24 +135,24 @@ var _folderEventLogHelper_folderListener
   /**
    * Notice when user activity adds/removes tags or changes a message's
    *  status.
    */
   OnItemPropertyFlagChanged: function felh_OnItemPropertyFlagChanged(
       aMsgHdr, aProperty, aOldValue, aNewValue) {
     mark_action("msgEvent", "OnItemPropertyFlagChanged",
                 ["Header", aMsgHdr,
-                 "had property " + aProperty.toString() + " have the " +
+                 "had property " + aProperty + " have the " +
                  "following bits change: " +
                  _explode_flags(aOldValue ^ aNewValue,
                                 Components.interfaces.nsMsgMessageFlags)]);
   },
 
   /**
    * Get folder loaded notifications for folders that had to do some
    *  (asynchronous) processing before they could be opened.
    */
   OnItemEvent: function felh_OnItemEvent(aFolder, aEvent) {
     mark_action("msgEvent", "OnItemEvent",
-                [aFolder, aEvent.toString()]);
+                [aFolder, aEvent]);
   },
 };
 
--- a/mailnews/test/resources/mailTestUtils.js
+++ b/mailnews/test/resources/mailTestUtils.js
@@ -451,17 +451,17 @@ var mailTestUtils = {
    *     care of that.
    */
   updateFolderAndNotify: function(aFolder, aCallback, aCallbackThis,
       aCallbackArgs, aSomeoneElseWillTriggerTheUpdate) {
     // register for the folder loaded notification ahead of time... even though
     //  we may not need it...
     let folderListener = {
       OnItemEvent: function (aEventFolder, aEvent) {
-        if (aEvent.toString() == "FolderLoaded" && aFolder.URI == aEventFolder.URI) {
+        if (aEvent == "FolderLoaded" && aFolder.URI == aEventFolder.URI) {
           MailServices.mailSession.RemoveFolderListener(this);
           aCallback.apply(aCallbackThis, aCallbackArgs);
         }
       }
     };
 
     MailServices.mailSession.AddFolderListener(folderListener, Ci.nsIFolderListener.event);
 
--- a/suite/mailnews/messageWindow.js
+++ b/suite/mailnews/messageWindow.js
@@ -32,45 +32,43 @@ var folderListener = {
     if (item instanceof Components.interfaces.nsIMsgDBHdr &&
         extractMsgKeyFromURI() == item.messageKey)
       gCurrentMessageIsDeleted = true;
   },
 
   OnItemPropertyChanged: function(item, property, oldValue, newValue) {},
   OnItemIntPropertyChanged: function(item, property, oldValue, newValue) {
     if (item.URI == gCurrentFolderUri) {
-      if (property.toString() == "TotalMessages" || property.toString() == "TotalUnreadMessages") {
+      if (property == "TotalMessages" || property == "TotalUnreadMessages") {
         UpdateStandAloneMessageCounts();
       }
     }
   },
   OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {},
   OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue){},
   OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {},
 
   OnItemEvent: function(folder, event) {
-    var eventType = event.toString();
-
-    if (eventType == "DeleteOrMoveMsgCompleted")
+    if (event == "DeleteOrMoveMsgCompleted")
       HandleDeleteOrMoveMsgCompleted(folder);
-    else if (eventType == "DeleteOrMoveMsgFailed")
+    else if (event == "DeleteOrMoveMsgFailed")
       HandleDeleteOrMoveMsgFailed(folder);
-    else if (eventType == "FolderLoaded") {
+    else if (event == "FolderLoaded") {
       if (folder) {
         var uri = folder.URI;
         if (uri == gCurrentFolderToRerootForStandAlone) {
           gCurrentFolderToRerootForStandAlone = null;
           folder.endFolderLoading();
           if (gRerootOnFolderLoadForStandAlone) {
             RerootFolderForStandAlone(uri);
           }
         }
       }
     }
-    else if (eventType == "JunkStatusChanged") {
+    else if (event == "JunkStatusChanged") {
       HandleJunkStatusChanged(folder);
     }
   }
 }
 
 var messagepaneObserver = {
 
   canHandleMultipleItems: false,
--- a/suite/mailnews/msgMail3PaneWindow.js
+++ b/suite/mailnews/msgMail3PaneWindow.js
@@ -120,18 +120,17 @@ var folderListener =
   OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue) {},
   OnItemPropertyFlagChanged:    function(item, property, oldFlag,  newFlag)  {},
 
   OnItemIntPropertyChanged: function(item, property, oldValue, newValue)
   {
     // handle the currently visible folder
     if (item == gMsgFolderSelected)
     {
-      let prop = property.toString();
-      if (prop == "TotalMessages" || prop == "TotalUnreadMessages")
+      if (property == "TotalMessages" || property == "TotalUnreadMessages")
       {
         UpdateStatusMessageCounts(gMsgFolderSelected);
         item = item.QueryInterface(Components.interfaces.nsIRDFResource);
         UpdateLocationBar(item);
       }
     }
 
     // check folders shown in tabs
@@ -149,18 +148,17 @@ var folderListener =
           // update tab title incl. any icon styles
           tabmail.setTabTitle(tabmail.tabInfo[i]);
         }
       }
     }
   },
 
     OnItemEvent: function(folder, event) {
-      var eventType = event.toString();
-      if (eventType == "FolderLoaded") {
+      if (event == "FolderLoaded") {
         if (folder) {
           const nsMsgFolderFlags = Components.interfaces.nsMsgFolderFlags;
           var scrolled = false;
           var msgFolder = folder.QueryInterface(Components.interfaces.nsIMsgFolder);
           var uri = folder.URI;
           var rerootingFolder = (uri == gCurrentFolderToReroot);
           if (rerootingFolder) {
             viewDebug("uri = gCurrentFolderToReroot, setting gQSViewIsDirty\n");
@@ -258,17 +256,17 @@ var folderListener =
                   viewDebug("changing view by value\n");
                   ViewChangeByValue(result);
                 }
               }
             }
           }
         }
       }
-      else if (eventType == "ImapHdrDownloaded") {
+      else if (event == "ImapHdrDownloaded") {
         if (folder) {
           var imapFolder = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
           if (imapFolder) {
             var hdrParser = imapFolder.hdrParser;
             if (hdrParser) {
               var msgHdr = hdrParser.GetNewMsgHdr();
               if (msgHdr)
               {
@@ -280,33 +278,33 @@ var folderListener =
                 if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
                   msgHdr.setStringProperty("imageSize", "1");
                 }
               }
             }
           }
         }
       }
-      else if (eventType == "DeleteOrMoveMsgCompleted") {
+      else if (event == "DeleteOrMoveMsgCompleted") {
         HandleDeleteOrMoveMsgCompleted(folder);
       }
-      else if (eventType == "DeleteOrMoveMsgFailed") {
+      else if (event == "DeleteOrMoveMsgFailed") {
         HandleDeleteOrMoveMsgFailed(folder);
       }
-      else if (eventType == "AboutToCompact") {
+      else if (event == "AboutToCompact") {
         if (gDBView)
           gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage;
       }
-      else if (eventType == "CompactCompleted") {
+      else if (event == "CompactCompleted") {
         HandleCompactCompleted(folder);
       }
-      else if (eventType == "RenameCompleted") {
+      else if (event == "RenameCompleted") {
         SelectFolder(folder.URI);
       }
-      else if (eventType == "JunkStatusChanged") {
+      else if (event == "JunkStatusChanged") {
         HandleJunkStatusChanged(folder);
       }
     }
 }
 
 var folderObserver = {
     canDrop: function(index, orientation)
     {
--- a/suite/mailnews/search/SearchDialog.js
+++ b/suite/mailnews/search/SearchDialog.js
@@ -195,22 +195,20 @@ var gFolderListener = {
     OnItemIntPropertyChanged: function(item, property, oldValue, newValue) {},
 
     OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) {},
 
     OnItemUnicharPropertyChanged: function(item, property, oldValue, newValue){},
     OnItemPropertyFlagChanged: function(item, property, oldFlag, newFlag) {},
 
     OnItemEvent: function(folder, event) {
-        var eventType = event.toString();
-
-        if (eventType == "DeleteOrMoveMsgCompleted") {
+        if (event == "DeleteOrMoveMsgCompleted") {
             HandleDeleteOrMoveMessageCompleted(folder);
         }
-        else if (eventType == "DeleteOrMoveMsgFailed") {
+        else if (event == "DeleteOrMoveMsgFailed") {
             HandleDeleteOrMoveMessageFailed(folder);
         }
     }
 }
 
 function HideSearchColumn(id)
 {
   var col = document.getElementById(id);