Bug 1575636 - Handle saved message with embedded images better on reply. r=aceman a=jorgk
authorJorg K <jorgk@jorgk.com>
Wed, 21 Aug 2019 22:43:02 +0200
changeset 36189 07ec429a494851508d76355c3337e03a28c07adc
parent 36188 b7c5e0ad60a05e6efc93b697549f9e03eb9d3fdd
child 36190 4b4dd99160f315c1290d49437ae219b888ab4835
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersaceman, jorgk
bugs1575636
Bug 1575636 - Handle saved message with embedded images better on reply. r=aceman a=jorgk
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -6718,17 +6718,25 @@ function InitEditor() {
     }
     if (gOriginalMsgURI) {
       let msgSvc = Cc["@mozilla.org/messenger;1"]
         .createInstance(Ci.nsIMessenger)
         .messageServiceFromURI(gOriginalMsgURI);
       let originalMsgNeckoURI = {};
       msgSvc.GetUrlForUri(gOriginalMsgURI, originalMsgNeckoURI, null);
       if (src.startsWith(removeQueryPart(originalMsgNeckoURI.value.spec,
-                                         "type=application/x-message-display"))) {
+                                         "type=application/x-message-display"))
+          ||
+          // Special hack for saved messages.
+          (src.includes("?number=0&") &&
+           originalMsgNeckoURI.value.spec.startsWith("file://") &&
+           src.startsWith(
+             removeQueryPart(originalMsgNeckoURI.value.spec,
+                             "type=application/x-message-display")
+             .replace("file://", "mailbox://") + "number=0"))) {
         // Reply/Forward/Edit Draft/Edit as New can contain references to
         // images in the original message. Load those and make them data: URLs
         // now.
         event.target.classList.add("loading-internal");
         try {
           loadBlockedImage(src);
         } catch (e) {
           // Couldn't load the referenced image.