Add e_mail_part_get_is_attachment().
This commit is contained in:
@ -187,7 +187,7 @@ emfpe_headers_format (EMailFormatterExtension *extension,
|
||||
if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
|
||||
continue;
|
||||
|
||||
if (!mail_part->is_attachment)
|
||||
if (!e_mail_part_get_is_attachment (mail_part))
|
||||
continue;
|
||||
|
||||
if (mail_part->is_hidden)
|
||||
|
||||
@ -148,7 +148,7 @@ mail_formatter_print_run (EMailFormatter *formatter,
|
||||
if (mime_type == NULL)
|
||||
continue;
|
||||
|
||||
if (part->is_attachment) {
|
||||
if (e_mail_part_get_is_attachment (part)) {
|
||||
if (e_mail_part_get_cid (part) != NULL)
|
||||
continue;
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ mail_formatter_quote_run (EMailFormatter *formatter,
|
||||
if (part->is_hidden)
|
||||
continue;
|
||||
|
||||
if (part->is_attachment)
|
||||
if (e_mail_part_get_is_attachment (part))
|
||||
continue;
|
||||
|
||||
mime_type = e_mail_part_get_mime_type (part);
|
||||
|
||||
@ -98,7 +98,7 @@ empe_mp_digest_parse (EMailParserExtension *extension,
|
||||
|
||||
wrap_as_attachment =
|
||||
(mail_part != NULL) &&
|
||||
!mail_part->is_attachment;
|
||||
!e_mail_part_get_is_attachment (mail_part);
|
||||
|
||||
/* Force the message to be collapsable */
|
||||
if (wrap_as_attachment)
|
||||
|
||||
@ -89,7 +89,7 @@ empe_mp_mixed_parse (EMailParserExtension *extension,
|
||||
* not multipart/related. */
|
||||
if (mail_part != NULL &&
|
||||
e_mail_part_get_cid (mail_part) != NULL &&
|
||||
(!mail_part->is_attachment ||
|
||||
(!e_mail_part_get_is_attachment (mail_part) ||
|
||||
mail_part->is_hidden)) {
|
||||
|
||||
e_mail_parser_wrap_as_attachment (
|
||||
@ -99,7 +99,7 @@ empe_mp_mixed_parse (EMailParserExtension *extension,
|
||||
} else if (mail_part == NULL ||
|
||||
(camel_content_type_is (ct, "message", "rfc822") &&
|
||||
mail_part != NULL &&
|
||||
!mail_part->is_attachment)) {
|
||||
!e_mail_part_get_is_attachment (mail_part))) {
|
||||
|
||||
e_mail_parser_wrap_as_attachment (
|
||||
parser, subpart, part_id, &work_queue);
|
||||
|
||||
@ -367,7 +367,7 @@ e_mail_parser_parse_sync (EMailParser *parser,
|
||||
e_mail_part_get_cid (part),
|
||||
e_mail_part_get_mime_type (part),
|
||||
part->is_hidden ? 1 : 0,
|
||||
part->is_attachment ? 1 : 0);
|
||||
e_mail_part_get_is_attachment (part) ? 1 : 0);
|
||||
|
||||
e_mail_part_unref (part);
|
||||
}
|
||||
@ -471,7 +471,7 @@ e_mail_parser_parse_finish (EMailParser *parser,
|
||||
e_mail_part_get_cid (part),
|
||||
e_mail_part_get_mime_type (part),
|
||||
part->is_hidden ? 1 : 0,
|
||||
part->is_attachment ? 1 : 0);
|
||||
e_mail_part_get_is_attachment (part) ? 1 : 0);
|
||||
|
||||
e_mail_part_unref (part);
|
||||
}
|
||||
|
||||
@ -267,6 +267,14 @@ e_mail_part_set_mime_type (EMailPart *part,
|
||||
part->mime_type = g_strdup (mime_type);
|
||||
}
|
||||
|
||||
gboolean
|
||||
e_mail_part_get_is_attachment (EMailPart *part)
|
||||
{
|
||||
g_return_val_if_fail (part != NULL, FALSE);
|
||||
|
||||
return part->is_attachment;
|
||||
}
|
||||
|
||||
static EMailPartValidityPair *
|
||||
mail_part_find_validity_pair (EMailPart *part,
|
||||
guint32 validity_type)
|
||||
|
||||
@ -109,6 +109,7 @@ CamelMimePart * e_mail_part_ref_mime_part (EMailPart *part);
|
||||
const gchar * e_mail_part_get_mime_type (EMailPart *part);
|
||||
void e_mail_part_set_mime_type (EMailPart *part,
|
||||
const gchar *mime_type);
|
||||
gboolean e_mail_part_get_is_attachment (EMailPart *part);
|
||||
void e_mail_part_update_validity (EMailPart *part,
|
||||
CamelCipherValidity *validity,
|
||||
guint32 validity_type);
|
||||
|
||||
@ -1227,7 +1227,7 @@ is_only_text_part_in_this_level (GList *parts,
|
||||
if (part->is_hidden)
|
||||
continue;
|
||||
|
||||
if (part->is_attachment)
|
||||
if (e_mail_part_get_is_attachment (part))
|
||||
continue;
|
||||
|
||||
mime_type = e_mail_part_get_mime_type (part);
|
||||
@ -1331,7 +1331,7 @@ em_utils_message_to_html (CamelSession *session,
|
||||
* text part in the email, thus show it (and hide again later) */
|
||||
if (part->is_hidden && !hidden_text_html_part &&
|
||||
mime_type != NULL &&
|
||||
!part->is_attachment &&
|
||||
!e_mail_part_get_is_attachment (part) &&
|
||||
g_ascii_strcasecmp (mime_type, "text/html") == 0 &&
|
||||
is_only_text_part_in_this_level (head, part)) {
|
||||
part->is_hidden = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user