aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-19 22:23:24 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:20 +0800
commit5bea269ce8a7b2603f30f82f8ef3636795fb0cd0 (patch)
tree0d7026d3a5edfa9b641d1476e782523c141e936e
parentc025ffbb296501d2da8cba78aa6a14008055cf87 (diff)
downloadgsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.tar
gsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.tar.gz
gsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.tar.bz2
gsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.tar.lz
gsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.tar.xz
gsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.tar.zst
gsoc2013-evolution-5bea269ce8a7b2603f30f82f8ef3636795fb0cd0.zip
Add e_mail_part_get_cid().
-rw-r--r--em-format/e-mail-formatter-print-headers.c2
-rw-r--r--em-format/e-mail-formatter-print.c2
-rw-r--r--em-format/e-mail-parser-multipart-mixed.c2
-rw-r--r--em-format/e-mail-parser-multipart-related.c5
-rw-r--r--em-format/e-mail-parser.c4
-rw-r--r--em-format/e-mail-part-list.c2
-rw-r--r--em-format/e-mail-part.c8
-rw-r--r--em-format/e-mail-part.h1
8 files changed, 19 insertions, 7 deletions
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c
index 30d7a2827d..2345b78b05 100644
--- a/em-format/e-mail-formatter-print-headers.c
+++ b/em-format/e-mail-formatter-print-headers.c
@@ -190,7 +190,7 @@ emfpe_headers_format (EMailFormatterExtension *extension,
if (mail_part->is_hidden)
continue;
- if (mail_part->cid != NULL)
+ if (e_mail_part_get_cid (mail_part) != NULL)
continue;
attachments_count++;
diff --git a/em-format/e-mail-formatter-print.c b/em-format/e-mail-formatter-print.c
index f73fc493cf..7ad03be956 100644
--- a/em-format/e-mail-formatter-print.c
+++ b/em-format/e-mail-formatter-print.c
@@ -149,7 +149,7 @@ mail_formatter_print_run (EMailFormatter *formatter,
continue;
if (part->is_attachment) {
- if (part->cid != NULL)
+ if (e_mail_part_get_cid (part) != NULL)
continue;
g_queue_push_tail (&attachments, part);
diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c
index 5b8f9c1d7f..410d78bdeb 100644
--- a/em-format/e-mail-parser-multipart-mixed.c
+++ b/em-format/e-mail-parser-multipart-mixed.c
@@ -88,7 +88,7 @@ empe_mp_mixed_parse (EMailParserExtension *extension,
* because this is multipart/mixed,
* not multipart/related. */
if (mail_part != NULL &&
- mail_part->cid != NULL &&
+ e_mail_part_get_cid (mail_part) != NULL &&
(!mail_part->is_attachment ||
mail_part->is_hidden)) {
diff --git a/em-format/e-mail-parser-multipart-related.c b/em-format/e-mail-parser-multipart-related.c
index c90e5bf31d..45a5d440f5 100644
--- a/em-format/e-mail-parser-multipart-related.c
+++ b/em-format/e-mail-parser-multipart-related.c
@@ -124,9 +124,12 @@ empe_mp_related_parse (EMailParserExtension *extension,
for (link = head; link != NULL; link = g_list_next (link)) {
EMailPart *mail_part = link->data;
+ const gchar *cid;
+
+ cid = e_mail_part_get_cid (mail_part);
/* Don't render the part on its own! */
- if (e_mail_part_utils_body_refers (html_body, mail_part->cid))
+ if (e_mail_part_utils_body_refers (html_body, cid))
mail_part->is_hidden = TRUE;
}
diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c
index 39ffba8085..dbff9e5f77 100644
--- a/em-format/e-mail-parser.c
+++ b/em-format/e-mail-parser.c
@@ -364,7 +364,7 @@ e_mail_parser_parse_sync (EMailParser *parser,
" id: %s | cid: %s | mime_type: %s | "
"is_hidden: %d | is_attachment: %d\n",
e_mail_part_get_id (part),
- part->cid,
+ e_mail_part_get_cid (part),
part->mime_type,
part->is_hidden ? 1 : 0,
part->is_attachment ? 1 : 0);
@@ -468,7 +468,7 @@ e_mail_parser_parse_finish (EMailParser *parser,
" id: %s | cid: %s | mime_type: %s | "
"is_hidden: %d | is_attachment: %d\n",
e_mail_part_get_id (part),
- part->cid,
+ e_mail_part_get_cid (part),
part->mime_type,
part->is_hidden ? 1 : 0,
part->is_attachment ? 1 : 0);
diff --git a/em-format/e-mail-part-list.c b/em-format/e-mail-part-list.c
index c3ace21fa7..f7adcf9895 100644
--- a/em-format/e-mail-part-list.c
+++ b/em-format/e-mail-part-list.c
@@ -322,7 +322,7 @@ e_mail_part_list_ref_part (EMailPartList *part_list,
const gchar *candidate_id;
if (by_cid)
- candidate_id = candidate->cid;
+ candidate_id = e_mail_part_get_cid (candidate);
else
candidate_id = e_mail_part_get_id (candidate);
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index e6b0576d2e..0f4550cae5 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -183,6 +183,14 @@ e_mail_part_get_id (EMailPart *part)
return part->id;
}
+const gchar *
+e_mail_part_get_cid (EMailPart *part)
+{
+ g_return_val_if_fail (part != NULL, NULL);
+
+ return part->cid;
+}
+
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 f1e48051f8..5c071613a0 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -96,6 +96,7 @@ void e_mail_part_unref (EMailPart *part);
gsize e_mail_part_get_instance_size (EMailPart *part);
const gchar * e_mail_part_get_id (EMailPart *part);
+const gchar * e_mail_part_get_cid (EMailPart *part);
void e_mail_part_update_validity (EMailPart *part,
CamelCipherValidity *validity,
guint32 validity_type);