\n", cancellable, NULL); /* output some info about it */ text = em_format_describe_part (puri->part, mime_type); html = camel_text_to_html ( text, emfq->priv->text_html_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); camel_stream_write_string (stream, html, cancellable, NULL); g_free (html); g_free (text); camel_stream_write_string ( stream, " |
\n", cancellable, NULL); for (iter = emf->mail_part_list; iter; iter = iter->next) { EMFormatPURI *puri = iter->data; if (puri->is_attachment || !puri->write_func) continue; puri = iter->data; if (emfq->priv->flags & EM_FORMAT_QUOTE_HEADERS) { GString *buffer = g_string_new (""); emfq_format_headers (emfq, buffer, (CamelMedium *) puri->part); camel_stream_write_string (stream, buffer->str, cancellable, NULL); g_string_free (buffer, TRUE); } puri->write_func (emf, puri, stream, &info, cancellable); } if (emfq->priv->flags & EM_FORMAT_QUOTE_CITE) camel_stream_write_string ( stream, "", cancellable, NULL); } static void emfq_write_text_plain (EMFormat *emf, EMFormatPURI *puri, CamelStream *stream, EMFormatWriterInfo *info, GCancellable *cancellable) { EMFormatQuote *emfq = EM_FORMAT_QUOTE (emf); CamelStream *filtered_stream; CamelMimeFilter *html_filter; CamelMimeFilter *sig_strip; CamelContentType *type; const gchar *format; guint32 rgb = 0x737373, flags; if (!puri->part) return; flags = emfq->priv->text_html_flags; /* Check for RFC 2646 flowed text. */ type = camel_mime_part_get_content_type (puri->part); if (camel_content_type_is(type, "text", "plain") && (format = camel_content_type_param(type, "format")) && !g_ascii_strcasecmp(format, "flowed")) flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; filtered_stream = camel_stream_filter_new (stream); if ((emfq->priv->flags & EM_FORMAT_QUOTE_KEEP_SIG) == 0) { sig_strip = em_stripsig_filter_new (TRUE); camel_stream_filter_add ( CAMEL_STREAM_FILTER (filtered_stream), sig_strip); g_object_unref (sig_strip); } html_filter = camel_mime_filter_tohtml_new (flags, rgb); camel_stream_filter_add ( CAMEL_STREAM_FILTER (filtered_stream), html_filter); g_object_unref (html_filter); em_format_format_text ( EM_FORMAT (emfq), filtered_stream, CAMEL_DATA_WRAPPER (puri->part), cancellable); camel_stream_flush (filtered_stream, cancellable, NULL); g_object_unref (filtered_stream); } static void emfq_write_text_enriched (EMFormat *emf, EMFormatPURI *puri, CamelStream *stream, EMFormatWriterInfo *info, GCancellable *cancellable) { CamelStream *filtered_stream; CamelMimeFilter *enriched; guint32 flags = 0; CamelContentType *ct; const gchar *mime_type = NULL; ct = camel_mime_part_get_content_type (puri->part); if (ct) { mime_type = camel_content_type_simple (ct); camel_content_type_unref (ct); } if (g_strcmp0 (mime_type, "text/richtext") == 0) { flags = CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT; camel_stream_write_string ( stream, "\n\n", cancellable, NULL); } else { camel_stream_write_string ( stream, "\n\n", cancellable, NULL); } enriched = camel_mime_filter_enriched_new (flags); filtered_stream = camel_stream_filter_new (stream); camel_stream_filter_add ( CAMEL_STREAM_FILTER (filtered_stream), enriched); g_object_unref (enriched); camel_stream_write_string (stream, "