Postscript attachments not shown in message preview

The application/postscript mime type had been handled by the text-hightlight
module, but thinking of it, it doesn't make much sense, because most users
would prefer to see the content rather in a postscript viewer, than
the source of the postscript file, thus this change removes the mime type
from the text-hightlight module. There had been also issues about thinking
that certain parts had been handled, while they did not, which this change
fixes as well.

The issue had been reported downstream at:
https://bugzilla.redhat.com/show_bug.cgi?id=1187327
This commit is contained in:
Milan Crha
2015-02-09 18:08:29 +01:00
parent 2e6c266024
commit a4af2d6aee
3 changed files with 7 additions and 10 deletions

View File

@ -56,10 +56,11 @@ process_part (EMailParser *parser,
CamelContentType *type;
EMailPart *mail_part;
gint s_len = part_id->len;
gboolean handled = TRUE;
type = camel_mime_part_get_content_type (part);
if (!camel_content_type_is (type, "text", "*")) {
e_mail_parser_parse_part (
handled = e_mail_parser_parse_part (
parser, CAMEL_MIME_PART (part), part_id,
cancellable, out_mail_parts);
@ -88,14 +89,14 @@ process_part (EMailParser *parser,
} else {
g_string_append_printf (part_id, ".inline.%d", part_number);
e_mail_parser_parse_part (
handled = e_mail_parser_parse_part (
parser, CAMEL_MIME_PART (part), part_id,
cancellable, out_mail_parts);
g_string_truncate (part_id, s_len);
}
return TRUE;
return handled;
}
static gboolean

View File

@ -55,6 +55,7 @@ empe_text_highlight_parse (EMailParserExtension *extension,
GQueue *out_mail_parts)
{
CamelContentType *ct;
gboolean handled;
gint len;
/* Prevent recursion */
@ -77,13 +78,13 @@ empe_text_highlight_parse (EMailParserExtension *extension,
/* All source codes and scripts are in general plain texts,
* so let text/plain parser handle it. */
e_mail_parser_parse_part_as (
handled = e_mail_parser_parse_part_as (
parser, part, part_id, "text/plain",
cancellable, out_mail_parts);
g_string_truncate (part_id, len);
return TRUE;
return handled;
}
static void

View File

@ -320,11 +320,6 @@ static struct Language other_languages[] = {
(const gchar *[]) { NULL }
},
{ "ps", N_("_PostScript"),
(const gchar *[]) { (gchar[]) { "ps" } , NULL },
(const gchar *[]) { (gchar[]) { "application/postscript" }, NULL }
},
{ "r", N_("_R"),
(const gchar *[]) { (gchar[]) { "r" }, NULL },
(const gchar *[]) { NULL }