aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-20 00:31:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:21 +0800
commit67227b428b5f730059ad9eefcc866fb4f4bf5e86 (patch)
treee01e448ebe350bde25d4bc1b1eee6d852b6ad4ce /em-format
parent543b4d932102206527f42c7a2d1bf049a4b2415d (diff)
downloadgsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.tar
gsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.tar.gz
gsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.tar.bz2
gsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.tar.lz
gsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.tar.xz
gsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.tar.zst
gsoc2013-evolution-67227b428b5f730059ad9eefcc866fb4f4bf5e86.zip
Add e_mail_part_get_validity_flags().
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-part.c20
-rw-r--r--em-format/e-mail-part.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index ba43e7e2f2..2339e0e3c1 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -371,3 +371,23 @@ e_mail_part_has_validity (EMailPart *part)
return !g_queue_is_empty (&part->validities);
}
+EMailPartValidityFlags
+e_mail_part_get_validity_flags (EMailPart *part)
+{
+ EMailPartValidityFlags flags = 0;
+ GList *head, *link;
+
+ g_return_val_if_fail (part != NULL, 0);
+
+ head = g_queue_peek_head_link (&part->validities);
+
+ for (link = head; link != NULL; link = g_list_next (link)) {
+ EMailPartValidityPair *pair = link->data;
+
+ if (pair != NULL)
+ flags |= pair->validity_type;
+ }
+
+ return flags;
+}
+
diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h
index bcb42707e0..cb25cb3020 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -119,6 +119,8 @@ CamelCipherValidity *
e_mail_part_get_validity (EMailPart *part,
guint32 validity_type);
gboolean e_mail_part_has_validity (EMailPart *part);
+EMailPartValidityFlags
+ e_mail_part_get_validity_flags (EMailPart *part);
G_END_DECLS