Bug 1468492 - Part 2. Port Bug 953165 [Picture in feed not showing] to SeaMonkey. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Mon, 02 Jul 2018 17:26:10 +0200
changeset 31497 774b3482506b979ecff7b0d5c1f9a4201aef6797
parent 31496 c5b6694800a75d997f7e9d5a3e2410e5393d7a2a
child 31498 d371734c7390fdc0926bf87958be7e9cc783ceb6
push id17
push userfrgrahl@gmx.net
push dateMon, 02 Jul 2018 15:28:35 +0000
treeherdercomm-esr60@876cea63d34d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1468492, 953165
Bug 1468492 - Part 2. Port Bug 953165 [Picture in feed not showing] to SeaMonkey. r=IanN a=IanN
suite/mailnews/msgHdrViewOverlay.js
--- a/suite/mailnews/msgHdrViewOverlay.js
+++ b/suite/mailnews/msgHdrViewOverlay.js
@@ -1370,25 +1370,31 @@ function GetCardForEmail(aEmailAddress)
  * @param uri The URI for the message containing the attachment
  * @param isExternalAttachment True if the attachment has been detached
  * @param size The size in bytes of the attachment
  */
 function createNewAttachmentInfo(contentType, url, displayName, uri,
                                  isExternalAttachment, size)
 {
   this.contentType = contentType;
-  this.url = url;
   this.displayName = displayName;
   this.uri = uri;
   this.isExternalAttachment = isExternalAttachment;
   this.attachment = this;
   this.size = size;
 
   let match = GlodaUtils.PART_RE.exec(url);
   this.partID = match && match[1];
+
+  // Remove [?&]part= from remote urls, after getting the partID.
+  if (url.startsWith("http") || url.startsWith("file"))
+    url = url.replace(new RegExp("[?&]part=" + this.partID + "$"), "");
+
+  this.url = url;
+
 }
 
 createNewAttachmentInfo.prototype.saveAttachment = function saveAttachment()
 {
   if (this.isExternalAttachment)
     // TODO: This displays "Save As" instead of "Save Attachment" in the title
     internalSave(this.url, null,
                  this.displayName, null,