aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-18 22:36:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:20 +0800
commit366b731a169ac54a0407f5d85879c38ba463398a (patch)
treeca2eb31c03938a2dcac4ae39c058fc714864af5d /em-format
parent794e28d23963fd875c0ffcad9c902f67744393bb (diff)
downloadgsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.gz
gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.zst
gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.zip
Add e_mail_part_id_has_prefix().
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-formatter-print-headers.c4
-rw-r--r--em-format/e-mail-part.c10
-rw-r--r--em-format/e-mail-part.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c
index 2345b78b05..6eec667463 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,
if (g_queue_is_empty (&mail_part->validities))
continue;
- if (!g_str_has_prefix (mail_part->id, part_id_prefix))
+ if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
continue;
if (e_mail_part_get_validity (mail_part, E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_SIGNED)) {
@@ -181,7 +181,7 @@ emfpe_headers_format (EMailFormatterExtension *extension,
for (link = head; link != NULL; link = g_list_next (link)) {
EMailPart *mail_part = E_MAIL_PART (link->data);
- if (!g_str_has_prefix (mail_part->id, part_id_prefix))
+ if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
continue;
if (!mail_part->is_attachment)
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index 15bd309f05..95e4929286 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -201,6 +201,16 @@ e_mail_part_set_cid (EMailPart *part,
part->cid = g_strdup (cid);
}
+gboolean
+e_mail_part_id_has_prefix (EMailPart *part,
+ const gchar *prefix)
+{
+ g_return_val_if_fail (part != NULL, FALSE);
+ g_return_val_if_fail (prefix != NULL, FALSE);
+
+ return g_str_has_prefix (part->id, prefix);
+}
+
static EMailPartValidityPair *
mail_part_find_validity_pair (EMailPart *part,
guint32 validity_type)
diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h
index e3e2e26aa5..8a71d3be9f 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -99,6 +99,8 @@ const gchar * e_mail_part_get_id (EMailPart *part);
const gchar * e_mail_part_get_cid (EMailPart *part);
void e_mail_part_set_cid (EMailPart *part,
const gchar *cid);
+gboolean e_mail_part_id_has_prefix (EMailPart *part,
+ const gchar *prefix);
void e_mail_part_update_validity (EMailPart *part,
CamelCipherValidity *validity,
guint32 validity_type);