if ((options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay) && (nsCRT::strncasecmp(aMessageURL, urlSpec, strlen(urlSpec)) == 0)) return NS_OK;
GenerateAttachmentData(MimeObject *object, const char *aMessageURL, MimeDisplayOptions *options,                       PRBool isAnAppleDoublePart, nsMsgAttachmentData *aAttachData){  nsXPIDLCString imappart;  nsXPIDLCString part;  PRBool isIMAPPart;  /* be sure the object has not be marked as Not to be an attachment */  if (object->dontShowAsAttachment)    return NS_OK;  part.Adopt(mime_part_address(object));  if (part.IsEmpty())     return NS_ERROR_OUT_OF_MEMORY;  if (options->missing_parts)    imappart.Adopt(mime_imap_part_address(object));  char *urlSpec = nsnull;  if (!imappart.IsEmpty())  {    isIMAPPart = PR_TRUE;    urlSpec = mime_set_url_imap_part(aMessageURL, imappart.get(), part.get());  }  else  {    isIMAPPart = PR_FALSE;    urlSpec = mime_set_url_part(aMessageURL, part.get(), PR_TRUE);  }  if (!urlSpec)    return NS_ERROR_OUT_OF_MEMORY;  nsMsgAttachmentData *tmp = &(aAttachData[attIndex++]);  nsresult rv = nsMimeNewURI(&(tmp->url), urlSpec, nsnull);	PR_FREEIF(urlSpec);  if ( (NS_FAILED(rv)) || (!tmp->url) )    return NS_ERROR_OUT_OF_MEMORY;  tmp->real_type = object->content_type ? nsCRT::strdup(object->content_type) : nsnull;  tmp->real_encoding = object->encoding ? nsCRT::strdup(object->encoding) : nsnull;    PRInt32 i;  char *charset = nsnull;  char *disp = MimeHeaders_get(object->headers, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE);  if (disp)   {    tmp->real_name = MimeHeaders_get_parameter(disp, "filename", &charset, nsnull);    if (isAnAppleDoublePart)      for (i = 0; i < 2 && !tmp->real_name; i ++)      {        PR_FREEIF(disp);        PR_FREEIF(charset);        disp = MimeHeaders_get(((MimeContainer *)object)->children[i]->headers, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE);        tmp->real_name = MimeHeaders_get_parameter(disp, "filename", &charset, nsnull);      }    if (tmp->real_name)    {      // check encoded type      //      // The parameter of Content-Disposition must use RFC 2231.      // But old Netscape 4.x and Outlook Express etc. use RFC2047.      // So we should parse both types.      char *fname = nsnull;      fname = mime_decode_filename(tmp->real_name, charset, options);      PR_FREEIF(charset);      if (fname && fname != tmp->real_name)      {        PR_FREEIF(tmp->real_name);        tmp->real_name = fname;      }    }    PR_FREEIF(disp);  }  disp = MimeHeaders_get(object->headers, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);  if (disp)  {    tmp->x_mac_type   = MimeHeaders_get_parameter(disp, PARAM_X_MAC_TYPE, nsnull, nsnull);    tmp->x_mac_creator= MimeHeaders_get_parameter(disp, PARAM_X_MAC_CREATOR, nsnull, nsnull);        if (!tmp->real_name || *tmp->real_name == 0)    {      PR_FREEIF(tmp->real_name);      tmp->real_name = MimeHeaders_get_parameter(disp, "name", &charset, nsnull);      if (isAnAppleDoublePart)        for (i = 0; i < 2 && !tmp->real_name; i ++)        {          PR_FREEIF(disp);          PR_FREEIF(charset);          disp = MimeHeaders_get(((MimeContainer *)object)->children[i]->headers, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);          tmp->real_name = MimeHeaders_get_parameter(disp, "name", &charset, nsnull);        }            if (tmp->real_name)      {        // check encoded type        //        // The parameter of Content-Disposition must use RFC 2231.        // But old Netscape 4.x and Outlook Express etc. use RFC2047.        // So we should parse both types.        char *fname = nsnull;        fname = mime_decode_filename(tmp->real_name, charset, options);        PR_FREEIF(charset);        if (fname && fname != tmp->real_name)        {          PR_Free(tmp->real_name);          tmp->real_name = fname;        }      }    }    PR_FREEIF(disp);  }  tmp->description = MimeHeaders_get(object->headers, HEADER_CONTENT_DESCRIPTION,                                      PR_FALSE, PR_FALSE);  // Now, do the right thing with the name!  if (!tmp->real_name && nsCRT::strcasecmp(tmp->real_type, MESSAGE_RFC822))  {    /* If this attachment doesn't have a name, just give it one... */    tmp->real_name = MimeGetStringByID(MIME_MSG_DEFAULT_ATTACHMENT_NAME);    if (tmp->real_name)    {      char *newName = PR_smprintf(tmp->real_name, part.get());      if (newName)      {        PR_Free(tmp->real_name);        tmp->real_name = newName;      }    }    else      tmp->real_name = mime_part_address(object);  }  ValidateRealName(tmp, object->headers);  if (isIMAPPart)  {    // If we get here, we should mark this attachment as not being    // downloaded.     tmp->notDownloaded = PR_TRUE;  }  return NS_OK;}