Revision 3281 libsylph/procheader.c

View differences:

procheader.c
688 688
		case H_CONTENT_TYPE:
689 689
			if (!g_ascii_strncasecmp(hp, "multipart", 9)) {
690 690
				MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME);
691
			} else if (!charset) {
692
				procmime_scan_content_type_str
693
					(hp, NULL, &charset, NULL, NULL);
691
			} else {
692
				if (!g_ascii_strncasecmp(hp, "text/html", 9)) {
693
					MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME_HTML);
694
				}
695
				if (!charset) {
696
					procmime_scan_content_type_str
697
						(hp, NULL, &charset, NULL, NULL);
698
				}
694 699
			}
695 700
			break;
696 701
		case H_SEEN:
......
740 745
		msginfo->inreplyto =
741 746
			g_strdup((gchar *)msginfo->references->data);
742 747

  
748
	if (MSG_IS_MIME(msginfo->flags)) {
749
		MimeInfo *mimeinfo, *part;
750
		gboolean has_html = FALSE;
751

  
752
		part = mimeinfo = procmime_scan_message_stream(fp);
753
		while (part) {
754
			if (part->mime_type != MIME_TEXT &&
755
			    part->mime_type != MIME_TEXT_HTML &&
756
			    part->mime_type != MIME_MULTIPART)
757
				break;
758
			if (part->mime_type == MIME_TEXT_HTML)
759
				has_html = TRUE;
760
			part = procmime_mimeinfo_next(part);
761
		}
762

  
763
		if (has_html && !part) {
764
			MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME_HTML);
765
		}
766

  
767
		procmime_mimeinfo_free_all(mimeinfo);
768
	}
769

  
743 770
	g_free(charset);
744 771

  
745 772
	return msginfo;

Also available in: Unified diff