function deleted.
* camel/camel-formatter.c (mime_part_to_html): function deleted. svn path=/trunk/; revision=1688
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
2000-02-07 Matt Loper <matt.loper@splashtech.com>
|
||||
|
||||
* camel/camel-formatter.c (mime_part_to_html): function deleted.
|
||||
|
||||
* tests/test-formatter.c (print_usage_and_quit): New function,
|
||||
which gives usage information.
|
||||
|
||||
|
||||
@ -661,80 +661,4 @@ _finalize (GtkObject* object)
|
||||
}
|
||||
|
||||
|
||||
<<<<<<< camel-formatter.c
|
||||
=======
|
||||
/* GARBAGE GARBAGE GARBAGE GARBAGE GARBAGE GARBAGE */
|
||||
/* GARBAGE GARBAGE GARBAGE GARBAGE GARBAGE GARBAGE */
|
||||
/* GARBAGE GARBAGE GARBAGE GARBAGE GARBAGE GARBAGE */
|
||||
|
||||
/* Converts the contents of a CamelMimePart into HTML */
|
||||
static void
|
||||
mime_part_to_html (CamelFormatter* formatter, CamelMimePart* part,
|
||||
CamelStream* stream)
|
||||
{
|
||||
/* Get the mime-type of the mime message */
|
||||
gchar* mime_type_whole = /* ex. "text/plain" */
|
||||
MIME_TYPE_WHOLE (part);
|
||||
|
||||
/* get the contents of the mime message */
|
||||
CamelDataWrapper* message_contents =
|
||||
camel_medium_get_content_object (CAMEL_MEDIUM (part));
|
||||
|
||||
/* if we're dealing with a multipart/related message... */
|
||||
if (strcase_equal (MIME_TYPE_WHOLE (part), "multipart/related")) {
|
||||
|
||||
CamelMultipart *multipart = CAMEL_MULTIPART (
|
||||
message_contents);
|
||||
|
||||
int i, max_multiparts;
|
||||
|
||||
/* find out out many parts are in it...*/
|
||||
max_multiparts = camel_multipart_get_number (multipart);
|
||||
|
||||
/* ...and write each one, as html, into the stream. */
|
||||
for (i = 0; i < max_multiparts; i++) {
|
||||
CamelMimeBodyPart* body_part =
|
||||
camel_multipart_get_part (multipart, i);
|
||||
|
||||
/* TODO: insert html delimiters, probably
|
||||
* <hr>'s, before and after the following
|
||||
* call*/
|
||||
mime_part_to_html (
|
||||
formatter, CAMEL_MIME_PART (body_part),
|
||||
stream);
|
||||
}
|
||||
}
|
||||
|
||||
/* okay, it's not multipart-related, so we have only one 'thing'
|
||||
* to convert to html */
|
||||
else {
|
||||
CamelMimePart* mime_part = NULL;
|
||||
|
||||
/* if it's a multipart/alternate, track down one we can
|
||||
* convert to html (if any) */
|
||||
if (strcase_equal (mime_type_whole, "multipart/alternate")) {
|
||||
mime_part =
|
||||
find_preferred_displayable_body_part_in_multipart_alternative (
|
||||
CAMEL_MULTIPART(message_contents));
|
||||
}
|
||||
|
||||
else if (strcase_equal (mime_type_whole, "text/plain") ||
|
||||
strcase_equal (mime_type_whole, "text/html")) {
|
||||
|
||||
mime_part = CAMEL_MIME_PART (message_contents);
|
||||
}
|
||||
|
||||
if (message_contents) {
|
||||
|
||||
}
|
||||
else {
|
||||
gchar *error_string = g_strdup_printf (
|
||||
"Sorry, but I don't know how to display items of type %s\n",
|
||||
mime_type_whole);
|
||||
|
||||
camel_stream_write_string (stream, error_string);
|
||||
g_free (error_string);
|
||||
}
|
||||
}
|
||||
}
|
||||
>>>>>>> 1.6
|
||||
|
||||
Reference in New Issue
Block a user