Bug 1571433 - disable "detach attachment" menuitems when displaying an eml file. r=mkmelin
authoraceman <acelists@atlas.sk>
Sun, 03 Nov 2019 20:25:51 +0100
changeset 37418 0f3fc12f7371151f51c0748225a39eaab681b5ac
parent 37417 8aa9c7cbd3f94bb90393e5c4a3b34a27bc147d14
child 37419 e59f4d018a053fff1484243fff19c02662a5a869
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersmkmelin
bugs1571433
Bug 1571433 - disable "detach attachment" menuitems when displaying an eml file. r=mkmelin
mail/base/content/msgHdrView.js
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -2207,17 +2207,18 @@ AttachmentInfo.prototype = {
 
 /**
  * Return true if possible attachments in the currently loaded message can be
  * deleted/detached.
  */
 function CanDetachAttachments() {
   var canDetach =
     !gFolderDisplay.selectedMessageIsNews &&
-    (!gFolderDisplay.selectedMessageIsImap || MailOfflineMgr.isOnline());
+    (!gFolderDisplay.selectedMessageIsImap || MailOfflineMgr.isOnline()) &&
+    !gMessageDisplay.isDummy; // We can't detach from loaded eml files yet.
   if (canDetach && "content-type" in currentHeaderData) {
     canDetach = !ContentTypeIsSMIME(
       currentHeaderData["content-type"].headerValue
     );
   }
 
   return canDetach;
 }