if ( (child->parent) && (mime_typep(child->parent, (MimeObjectClass *) &mimeMultipartAppleDoubleClass)) ) continue;
BuildAttachmentList(MimeObject *aChild, nsMsgAttachmentData *aAttachData,                    const char *aMessageURL){  char                  *disp;  PRInt32               i;  MimeContainer         *cobj = (MimeContainer *) aChild;  nsMsgAttachmentData   *tmp = nsnull;  PRBool                isAlternativeOrRelated;  if ( (!aChild) || (!cobj->children) )    return NS_OK;  if (MimeObjectChildIsMessageBody(aChild, &isAlternativeOrRelated))    i = 1;  else    i = 0;  for (; i<cobj->nchildren ; i++)   {    MimeObject    *child = cobj->children[i];    char          *part = mime_part_address(child);    char          *imappart = NULL;    if ( NS_FAILED(BuildAttachmentList((MimeObject *)child, aAttachData, aMessageURL)) )      return NS_OK;    if (!part)       return NS_ERROR_OUT_OF_MEMORY;    if (aChild->options->missing_parts)      imappart = mime_imap_part_address(child);    char *urlSpec = nsnull;    if (imappart)      urlSpec = mime_set_url_imap_part(aMessageURL, imappart, part);    else      urlSpec = mime_set_url_part(aMessageURL, part, PR_TRUE);  	  PR_FREEIF(part);  	PR_FREEIF(imappart);    if (!urlSpec)      return NS_ERROR_OUT_OF_MEMORY;    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 = child->content_type ? nsCRT::strdup(child->content_type) : NULL;    tmp->real_encoding = child->encoding ? nsCRT::strdup(child->encoding) : NULL;    disp = MimeHeaders_get(child->headers, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE);    if (disp)     {      tmp->real_name = MimeHeaders_get_parameter(disp, "filename", NULL, NULL);      if (tmp->real_name)      {        char *fname = NULL;        fname = mime_decode_filename(tmp->real_name);        if (fname && fname != tmp->real_name)        {          PR_FREEIF(tmp->real_name);          tmp->real_name = fname;        }      }      PR_FREEIF(disp);    }    disp = MimeHeaders_get(child->headers, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);    if (disp)    {      tmp->x_mac_type   = MimeHeaders_get_parameter(disp, PARAM_X_MAC_TYPE, NULL, NULL);      tmp->x_mac_creator= MimeHeaders_get_parameter(disp, PARAM_X_MAC_CREATOR, NULL, NULL);      if (!tmp->real_name || *tmp->real_name == 0)      {        PR_FREEIF(tmp->real_name);        tmp->real_name = MimeHeaders_get_parameter(disp, "name", NULL, NULL);        if (tmp->real_name)        {          char *fname = NULL;          fname = mime_decode_filename(tmp->real_name);          if (fname && fname != tmp->real_name)          {            PR_Free(tmp->real_name);            tmp->real_name = fname;          }        }      }      PR_FREEIF(disp);    }    tmp->description = MimeHeaders_get(child->headers, HEADER_CONTENT_DESCRIPTION,                                        PR_FALSE, PR_FALSE);    // Now, do the right thing with the name!    ValidateRealName(tmp);  }  return NS_OK;}