Bug 1644084 - Remove redundant code for deleting contacts. r=rjl
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 01 Jul 2020 14:45:52 +1200
changeset 30028 926e7403d2a87e3bd461a02a0594aca7dab92980
parent 30027 9092f30233339f894cbb1910a39f0c962e8a98f8
child 30029 8b55e4dbec550ee94581636afcb8661a82200f92
push id17653
push usergeoff@darktrojan.net
push dateWed, 01 Jul 2020 03:41:23 +0000
treeherdercomm-central@926e7403d2a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrjl
bugs1644084
Bug 1644084 - Remove redundant code for deleting contacts. r=rjl
mail/components/addrbook/content/abCommon.js
--- a/mail/components/addrbook/content/abCommon.js
+++ b/mail/components/addrbook/content/abCommon.js
@@ -511,35 +511,18 @@ function AbDelete() {
   // Finally, show our smart confirmation message, and act upon it!
   if (
     !Services.prompt.confirm(window, confirmDeleteTitle, confirmDeleteMessage)
   ) {
     // Deletion cancelled by user.
     return;
   }
 
-  if (selectedDir === null) {
-    // Delete cards from "All Address Books" view.
-    let cards = GetSelectedAbCards();
-    for (let i = 0; i < cards.length; i++) {
-      let dirId = cards[i].directoryId.substring(
-        0,
-        cards[i].directoryId.indexOf("&")
-      );
-
-      let directory = MailServices.ab.getDirectoryFromId(dirId);
-      if (directory) {
-        directory.deleteCards([cards[i]]);
-      }
-    }
-    SetAbView();
-  } else {
-    // Delete cards from address books or mailing lists.
-    gAbView.deleteSelectedCards();
-  }
+  // Delete cards from address books or mailing lists.
+  gAbView.deleteSelectedCards();
 }
 
 function AbNewCard() {
   goNewCardDialog(getSelectedDirectoryURI());
 }
 
 function AbEditCard(card) {
   // Need a card,