Bug 665313 - Opening message attachment does not work r=mnyromyr a=iann for CLOSED TREE 1167a08ced50 BETA_5_END
authorNeil Rashbrook <neil@httl.net>
Sun, 26 Jun 2011 22:13:25 +0100
changeset 7826 1167a08ced50d5138c201956656b9c20efb70c07
parent 7823 f3d4a363648d905c8981780a5d6f1020a92a9ab1
child 7841 6476800b44b50da6fdc29a1446caefdd0e4873af
push id28
push useriann_cvs@blueyonder.co.uk
push dateSun, 26 Jun 2011 21:12:15 +0000
treeherdercomm-beta@1167a08ced50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmnyromyr, iann
bugs665313
Bug 665313 - Opening message attachment does not work r=mnyromyr a=iann for CLOSED TREE
suite/mailnews/msgHdrViewOverlay.js
--- a/suite/mailnews/msgHdrViewOverlay.js
+++ b/suite/mailnews/msgHdrViewOverlay.js
@@ -1220,18 +1220,30 @@ createNewAttachmentInfo.prototype.viewAt
   if (!this.isExternalAttachment)
     url += "&filename=" + encodeURIComponent(this.displayName);
   openDialog("chrome://global/content/viewSource.xul",
              "_blank", "all,dialog=no", url);
 }
 
 createNewAttachmentInfo.prototype.openAttachment = function openAttachment()
 {
-  if (this.contentType == "text/x-moz-deleted")
-    return;
+  switch (this.contentType)
+  {
+    // As of bug 599119, isTypeSupported returns true for messages, but
+    // attached messages don't open reliably in the browser, so pretend
+    // they're not supported and open a message window for them instead.
+    case "message/rfc822":
+      var url = this.url + "&type=application/x-message-display";
+      window.openDialog("chrome://messenger/content/messageWindow.xul",
+                        "_blank", "all,dialog=no",
+                        Services.io.newURI(url, null, null));
+      return;
+    case "text/x-moz-deleted":
+      return;
+  }
 
   var webNavigationInfo =
         Components.classes["@mozilla.org/webnavigation-info;1"]
                   .getService(Components.interfaces.nsIWebNavigationInfo);
 
   if (webNavigationInfo.isTypeSupported(this.contentType, null))
     openAsExternal(this.url);
   else