aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--em-format/e-mail-formatter-print-headers.c2
-rw-r--r--em-format/e-mail-part.c9
-rw-r--r--em-format/e-mail-part.h1
3 files changed, 11 insertions, 1 deletions
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c
index 591c28ee80..6e4826d80b 100644
--- a/em-format/e-mail-formatter-print-headers.c
+++ b/em-format/e-mail-formatter-print-headers.c
@@ -137,7 +137,7 @@ emfpe_headers_format (EMailFormatterExtension *extension,
for (link = head; link != NULL; link = g_list_next (link)) {
EMailPart *mail_part = link->data;
- if (g_queue_is_empty (&mail_part->validities))
+ if (!e_mail_part_has_validity (mail_part))
continue;
if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index b7e4d67d34..ba43e7e2f2 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -362,3 +362,12 @@ e_mail_part_get_validity (EMailPart *part,
return pair ? pair->validity : NULL;
}
+
+gboolean
+e_mail_part_has_validity (EMailPart *part)
+{
+ g_return_val_if_fail (part != NULL, FALSE);
+
+ return !g_queue_is_empty (&part->validities);
+}
+
diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h
index 19e62ac1cb..bcb42707e0 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -118,6 +118,7 @@ void e_mail_part_update_validity (EMailPart *part,
CamelCipherValidity *
e_mail_part_get_validity (EMailPart *part,
guint32 validity_type);
+gboolean e_mail_part_has_validity (EMailPart *part);
G_END_DECLS