}
MimeMultipart_create_child(MimeObject *obj){  MimeMultipart *mult = (MimeMultipart *) obj;  int           status;  char *ct = (mult->hdrs			  ? MimeHeaders_get (mult->hdrs, HEADER_CONTENT_TYPE,								 PR_TRUE, PR_FALSE)			  : 0);  const char *dct = (((MimeMultipartClass *) obj->clazz)->default_part_type);  MimeObject *body = NULL;  mult->state = MimeMultipartPartFirstLine;  /* Don't pass in NULL as the content-type (this means that the	 auto-uudecode-hack won't ever be done for subparts of a	 multipart, but only for untyped children of message/rfc822.   */  body = mime_create(((ct && *ct) ? ct : (dct ? dct: TEXT_PLAIN)),					 mult->hdrs, obj->options);  PR_FREEIF(ct);  if (!body) return MIME_OUT_OF_MEMORY;  status = ((MimeContainerClass *) obj->clazz)->add_child(obj, body);  if (status < 0)	{	  mime_free(body);	  return status;	}#ifdef MIME_DRAFTS  if ( obj->options && 	   obj->options->decompose_file_p &&	   obj->options->is_multipart_msg &&	   obj->options->decompose_file_init_fn )	{	  if ( !mime_typep(obj,(MimeObjectClass*)&mimeMultipartRelatedClass) &&           !mime_typep(obj,(MimeObjectClass*)&mimeMultipartAlternativeClass) &&		   !mime_typep(obj,(MimeObjectClass*)&mimeMultipartSignedClass) &&#ifdef MIME_DETAIL_CHECK		   !mime_typep(body, (MimeObjectClass*)&mimeMultipartRelatedClass) &&		   !mime_typep(body, (MimeObjectClass*)&mimeMultipartAlternativeClass) &&		   !mime_typep(body,(MimeObjectClass*)&mimeMultipartSignedClass) #else           /* bug 21869 -- due to the fact that we are not generating the              correct mime class object for content-typ multipart/signed part              the above check failed. to solve the problem in general and not              to cause early temination when parsing message for opening as              draft we can simply make sure that the child is not a multipart              mime object. this way we could have a proper decomposing message              part functions set correctly */           !mime_typep(body, (MimeObjectClass*) &mimeMultipartClass)#endif#ifdef RICHIE_VCARD       && !mime_typep(body, (MimeObjectClass*)&mimeInlineTextVCardClass)#endif       )	  {		status = obj->options->decompose_file_init_fn ( obj->options->stream_closure, mult->hdrs );		if (status < 0) return status;	  }	}#endif /* MIME_DRAFTS */  /* Now that we've added this new object to our list of children,	 start its parser going (if we want to display it.)   */  body->output_p = (((MimeMultipartClass *) obj->clazz)->output_child_p(obj, body));  if (body->output_p)	{  	  status = body->clazz->parse_begin(body);#ifdef XP_MAC    /* if we are saving an apple double attachment, we need to set correctly the conten type of the channel */    if (mime_typep(obj, (MimeObjectClass *) &mimeMultipartAppleDoubleClass))    {      struct mime_stream_data *msd = (struct mime_stream_data *)body->options->stream_closure;      if (!body->options->write_html_p && body->content_type && !nsCRT::strcasecmp(body->content_type, APPLICATION_APPLEFILE))				if (msd && msd->channel)        	msd->channel->SetContentType(NS_LITERAL_CSTRING(APPLICATION_APPLEFILE));    }#endif	  if (status < 0) return status;	}  return 0;}