From 0e9c0268a8ae99b88d7b98539181c0e938e5cb53 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 14 Mar 2001 07:06:54 +0000 Subject: re-constify inbuf, to remove a warning. 2001-03-14 Not Zed * camel-mime-filter-charset.c (filter, complete): re-constify inbuf, to remove a warning. * camel-mime-parser.c (folder_scan_step): When we're out of data, run the filter_complete. For some reason the logic that was there was never being run, always try it now, i think it was to work around a buggy filter, rather than fix it the right way. * camel-folder-summary.c (summary_build_content_info): If indexing html parts, use the html filter to convert it to some indexable format. (summary_build_content_info): Reset the filters before adding them back to the stream, if they get re-used in a given instance (likely). * Makefile.am (libcamelinclude_HEADERS): Added camel-mime-filter-html.[ch]. (INCLUDES): Added xml clags 2001-03-05 Not Zed * camel-folder-search.c (camel_folder_search_class_init): Setup a new function, "uid" which matches uids. (search_uid): Implement the "match uid" command. svn path=/trunk/; revision=8705 --- camel/camel-folder-summary.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'camel/camel-folder-summary.c') diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 4e9e9e9d1b..9aaa61e50c 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -2053,7 +2054,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam CamelMessageContentInfo *info = NULL; struct _header_content_type *ct; int body; - int enc_id = -1, chr_id = -1, idx_id = -1; + int enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1; struct _CamelFolderSummaryPrivate *p = _PRIVATE(s); CamelMimeFilterCharset *mfc; CamelMessageContentInfo *part; @@ -2087,11 +2088,15 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam d(printf(" decoding base64\n")); if (p->filter_64 == NULL) p->filter_64 = camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_BASE64_DEC); + else + camel_mime_filter_reset((CamelMimeFilter *)p->filter_64); enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_64); } else if (!strcasecmp(encoding, "quoted-printable")) { d(printf(" decoding quoted-printable\n")); if (p->filter_qp == NULL) p->filter_qp = camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_QP_DEC); + else + camel_mime_filter_reset((CamelMimeFilter *)p->filter_qp); enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_qp); } else { d(printf(" ignoring encoding %s\n", encoding)); @@ -2109,6 +2114,8 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam mfc = camel_mime_filter_charset_new_convert(charset, "UTF-8"); if (mfc) g_hash_table_insert(p->filter_charset, g_strdup(charset), mfc); + } else { + camel_mime_filter_reset((CamelMimeFilter *)mfc); } if (mfc) { chr_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)mfc); @@ -2117,6 +2124,14 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam } } + if (header_content_type_is(ct, "text", "html")) { + if (p->filter_html == NULL) + p->filter_html = camel_mime_filter_html_new(); + else + camel_mime_filter_reset((CamelMimeFilter *)p->filter_html); + html_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_html); + } + /* and this filter actually does the indexing */ idx_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_index); } @@ -2126,6 +2141,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam /* and remove the filters */ camel_mime_parser_filter_remove(mp, enc_id); camel_mime_parser_filter_remove(mp, chr_id); + camel_mime_parser_filter_remove(mp, html_id); camel_mime_parser_filter_remove(mp, idx_id); break; case HSCAN_MULTIPART: -- cgit v1.2.3