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:40:42 +0200
changeset 28254 6dbea26cd8da41b13204abc6fb92f8436f956959
parent 28253 251973ed8f779f930137a4b7195471e8a70db53c
child 28255 292aa6de4ff3f7677b95d1d9986610a495970f09
push id2091
push userfrgrahl@gmx.net
push dateMon, 02 Jul 2018 15:41:42 +0000
treeherdercomm-esr52@cd762a183d3b [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
@@ -1373,25 +1373,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,