Bug 1343536 - Open message/rfc822 attachments correctly from the attachment bucket. r=aceman
authorJorg K <jorgk@jorgk.com>
Sat, 03 Mar 2018 18:00:04 +0100
changeset 31199 253ed51068545c9f2647b88e684737f62902b323
parent 31198 84c3d9dbc9ec87c8431a4fbb9c81098ae7ede008
child 31200 52cdb91d97684c8dc7198fc14e20364830bad421
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersaceman
bugs1343536
Bug 1343536 - Open message/rfc822 attachments correctly from the attachment bucket. r=aceman
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -5283,21 +5283,29 @@ nsAttachmentOpener.prototype =
 
   onStartURIOpen: function(uri)
   {
     return false;
   },
 
   doContent: function(contentType, isContentPreferred, request, contentHandler)
   {
-    return false;
+    // If we came here to display an attached message, make sure we provide a type.
+    if (/[?&]part=/i.test(request.URI.query))
+      request.URI.query += "&type=message/rfc822";
+    let newHandler = Cc["@mozilla.org/uriloader/content-handler;1?type=application/x-message-display"]
+                       .createInstance(Components.interfaces.nsIContentHandler);
+    newHandler.handleContent("application/x-message-display", this, request);
+    return true;
   },
 
   isPreferred: function(contentType, desiredContentType)
   {
+    if (contentType == "message/rfc822")
+      return true;
     return false;
   },
 
   canHandleContent: function(contentType, isContentPreferred, desiredContentType)
   {
     return false;
   },