(content_type ? PL_strcasecmp(content_type, MULTIPART_APPLEDOUBLE) : PR_TRUE) &&
(content_type ? nsCRT::strcasecmp(content_type, MULTIPART_APPLEDOUBLE) : PR_TRUE) &&
mime_create (const char *content_type, MimeHeaders *hdrs,			 MimeDisplayOptions *opts){  /* If there is no Content-Disposition header, or if the Content-Disposition	 is ``inline'', then we display the part inline (and let mime_find_class()	 decide how.)	 If there is any other Content-Disposition (either ``attachment'' or some	 disposition that we don't recognise) then we always display the part as	 an external link, by using MimeExternalObject to display it.	 But Content-Disposition is ignored for all containers except `message'.	 (including multipart/mixed, and multipart/digest.)  It's not clear if	 this is to spec, but from a usability standpoint, I think it's necessary.   */  MimeObjectClass *clazz = 0;  char *content_disposition = 0;  MimeObject *obj = 0;  char *override_content_type = 0;  static PRBool reverse_lookup = PR_FALSE, got_lookup_pref = PR_FALSE;  if (!got_lookup_pref)  {     nsIPref *pref = GetPrefServiceManager(opts);   // Pref service manager      if (pref)     {       pref->GetBoolPref("mailnews.autolookup_unknown_mime_types",&reverse_lookup);       got_lookup_pref = PR_TRUE;     }  }  /* There are some clients send out all attachments with a content-type	 of application/octet-stream.  So, if we have an octet-stream attachment,	 try to guess what type it really is based on the file extension.  I HATE	 that we have to do this...     If the preference "mailnews.autolookup_unknown_mime_types" is set to PR_TRUE,     then we try to do this EVERY TIME when we do not have an entry for the given	 MIME type in our table, not only when it's application/octet-stream. */  if (hdrs && opts && opts->file_type_fn &&	  /* ### mwelch - don't override AppleSingle */	  (content_type ? PL_strcasecmp(content_type, APPLICATION_APPLEFILE) : PR_TRUE) &&	  /* ## davidm Apple double shouldn't use this #$%& either. */	  (content_type ? PL_strcasecmp(content_type, MULTIPART_APPLEDOUBLE) : PR_TRUE) &&	  (!content_type ||	   !PL_strcasecmp(content_type, APPLICATION_OCTET_STREAM) ||	   !PL_strcasecmp(content_type, UNKNOWN_CONTENT_TYPE) ||	   (reverse_lookup#if 0	    && !NET_cinfo_find_info_by_type((char*)content_type))))#else        )))#endif	{	  char *name = MimeHeaders_get_name(hdrs);	  if (name)		{		  override_content_type = opts->file_type_fn (name,													  opts->stream_closure);		  PR_FREEIF(name);		  if (override_content_type &&			  !PL_strcasecmp(override_content_type, UNKNOWN_CONTENT_TYPE))			PR_FREEIF(override_content_type);		  if (override_content_type)			content_type = override_content_type;		}	}  clazz = mime_find_class(content_type, hdrs, opts, PR_FALSE);  PR_ASSERT(clazz);  if (!clazz) goto FAIL;  if (opts && opts->part_to_load)	/* Always ignore Content-Disposition when we're loading some specific	   sub-part (which may be within some container that we wouldn't otherwise	   descend into, if the container itself had a Content-Disposition of	   `attachment'. */	content_disposition = 0;  else if (mime_subclass_p(clazz,(MimeObjectClass *)&mimeContainerClass) &&		   !mime_subclass_p(clazz,(MimeObjectClass *)&mimeMessageClass))	/* Ignore Content-Disposition on all containers except `message'.	   That is, Content-Disposition is ignored for multipart/mixed objects,	   but is obeyed for message/rfc822 objects. */	content_disposition = 0;  else  {    /* Check to see if the plugin should override the content disposition       to make it appear inline. One example is a vcard which has a content       disposition of an "attachment;" */    if (force_inline_display(content_type))  		mime_SACopy(&content_disposition, "inline");    else  		content_disposition = (hdrs							   ? MimeHeaders_get(hdrs, HEADER_CONTENT_DISPOSITION, PR_TRUE, PR_FALSE)							   : 0);  }  if (!content_disposition || !PL_strcasecmp(content_disposition, "inline"))    ;	/* Use the class we've got. */  else    clazz = (MimeObjectClass *)&mimeExternalObjectClass;  PR_FREEIF(content_disposition);  obj = mime_new (clazz, hdrs, content_type); FAIL:  /* If we decided to ignore the content-type in the headers of this object	 (see above) then make sure that our new content-type is stored in the	 object itself.  (Or free it, if we're in an out-of-memory situation.)   */  if (override_content_type)	{	  if (obj)		{		  PR_FREEIF(obj->content_type);		  obj->content_type = override_content_type;		}	  else		{		  PR_Free(override_content_type);		}	}  return obj;}