diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-19 01:17:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-20 01:07:21 +0800 |
commit | 0ee556d346fe8976b63d9eb1c929b41a101037e1 (patch) | |
tree | 86f9c4ebce2cd4537e19f8a0db54ed3d70dd973b /mail | |
parent | f19058ea7a002e8ebf8351c55a86d3bb17a46cbc (diff) | |
download | gsoc2013-evolution-0ee556d346fe8976b63d9eb1c929b41a101037e1.tar.gz gsoc2013-evolution-0ee556d346fe8976b63d9eb1c929b41a101037e1.tar.zst gsoc2013-evolution-0ee556d346fe8976b63d9eb1c929b41a101037e1.zip |
Add e_mail_part_get_mime_type().
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-request.c | 2 | ||||
-rw-r--r-- | mail/em-utils.c | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c index 1c88b74e33..b4ecfce501 100644 --- a/mail/e-mail-request.c +++ b/mail/e-mail-request.c @@ -161,7 +161,7 @@ handle_mail_request (GSimpleAsyncResult *res, g_object_unref (mime_part); } else { if (mime_type == NULL) - mime_type = part->mime_type; + mime_type = e_mail_part_get_mime_type (part); e_mail_formatter_format_as ( formatter, &context, part, diff --git a/mail/em-utils.c b/mail/em-utils.c index 3e3f9f022b..fa6e704369 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1215,6 +1215,7 @@ is_only_text_part_in_this_level (GList *parts, level_len = dot - text_html_part_id; for (iter = parts; iter; iter = iter->next) { EMailPart *part = E_MAIL_PART (iter->data); + const gchar *mime_type; const gchar *part_id; if (part == NULL) @@ -1229,7 +1230,8 @@ is_only_text_part_in_this_level (GList *parts, if (part->is_attachment) continue; - if (part->mime_type == NULL) + mime_type = e_mail_part_get_mime_type (part); + if (mime_type == NULL) continue; part_id = e_mail_part_get_id (part); @@ -1238,7 +1240,7 @@ is_only_text_part_in_this_level (GList *parts, strncmp (text_html_part_id, part_id, level_len) != 0) continue; - if (g_ascii_strncasecmp (part->mime_type, "text/", 5) == 0) + if (g_ascii_strncasecmp (mime_type, "text/", 5) == 0) return FALSE; } @@ -1321,12 +1323,16 @@ em_utils_message_to_html (CamelSession *session, for (link = head; link != NULL; link = g_list_next (link)) { EMailPart *part = link->data; GList *vhead, *vlink; + const gchar *mime_type; + + mime_type = e_mail_part_get_mime_type (part); /* prefer-plain can hide HTML parts, even when it's the only * text part in the email, thus show it (and hide again later) */ if (part->is_hidden && !hidden_text_html_part && - part->mime_type && !part->is_attachment && - g_ascii_strcasecmp (part->mime_type, "text/html") == 0 && + mime_type != NULL && + !part->is_attachment && + g_ascii_strcasecmp (mime_type, "text/html") == 0 && is_only_text_part_in_this_level (head, part)) { part->is_hidden = FALSE; hidden_text_html_part = part; |