aboutsummaryrefslogtreecommitdiffstats
path: root/em-format/e-mail-formatter-print-headers.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-17 01:06:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:20 +0800
commitcd5a55f9812643109be6c2b0ed5d8f8ce655a4a9 (patch)
tree271b673b6e311d5cb44acdd0b6c1d1830aa6982e /em-format/e-mail-formatter-print-headers.c
parentf6f11a1da2dfa2c7616cd18b36a44fefd66f0c75 (diff)
downloadgsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar
gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.gz
gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.bz2
gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.lz
gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.xz
gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.tar.zst
gsoc2013-evolution-cd5a55f9812643109be6c2b0ed5d8f8ce655a4a9.zip
em-format cleanups.
Diffstat (limited to 'em-format/e-mail-formatter-print-headers.c')
-rw-r--r--em-format/e-mail-formatter-print-headers.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c
index 03d35c300c..b739d6ce96 100644
--- a/em-format/e-mail-formatter-print-headers.c
+++ b/em-format/e-mail-formatter-print-headers.c
@@ -87,7 +87,8 @@ emfpe_headers_format (EMailFormatterExtension *extension,
if (header->value && *header->value) {
raw_header.value = header->value;
- e_mail_formatter_format_header (formatter, str,
+ e_mail_formatter_format_header (
+ formatter, str,
CAMEL_MEDIUM (part->part), &raw_header,
header->flags | E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS,
"UTF-8");
@@ -102,7 +103,8 @@ emfpe_headers_format (EMailFormatterExtension *extension,
raw_header.value = g_strdup (header_value);
if (raw_header.value && *raw_header.value) {
- e_mail_formatter_format_header (formatter, str,
+ e_mail_formatter_format_header (
+ formatter, str,
CAMEL_MEDIUM (part->part), &raw_header,
header->flags | E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS,
"UTF-8");
@@ -115,7 +117,7 @@ emfpe_headers_format (EMailFormatterExtension *extension,
g_queue_free_full (headers_queue, (GDestroyNotify) e_mail_formatter_header_free);
- /* Get prefix of this PURI */
+ /* Get prefix of this PURI */
part_id_prefix = g_strndup (part->id, g_strrstr (part->id, ".") - part->id);
/* Add encryption/signature header */
@@ -164,7 +166,8 @@ emfpe_headers_format (EMailFormatterExtension *extension,
if (tmp->len > 0) {
raw_header.value = tmp->str;
e_mail_formatter_format_header (
- formatter, str, CAMEL_MEDIUM (part->part), &raw_header,
+ formatter, str,
+ CAMEL_MEDIUM (part->part), &raw_header,
E_MAIL_FORMATTER_HEADER_FLAG_BOLD |
E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS, "UTF-8");
}
@@ -174,22 +177,29 @@ emfpe_headers_format (EMailFormatterExtension *extension,
attachments_count = 0;
for (link = head; link != NULL; link = g_list_next (link)) {
- EMailPart *mail_part = link->data;
+ EMailPart *mail_part = E_MAIL_PART (link->data);
if (!g_str_has_prefix (mail_part->id, part_id_prefix))
continue;
- if (mail_part->is_attachment && !mail_part->cid &&
- !mail_part->is_hidden) {
- attachments_count++;
- }
+ if (!mail_part->is_attachment)
+ continue;
+
+ if (mail_part->is_hidden)
+ continue;
+
+ if (mail_part->cid != NULL)
+ continue;
+
+ attachments_count++;
}
if (attachments_count > 0) {
raw_header.name = _("Attachments");
raw_header.value = g_strdup_printf ("%d", attachments_count);
e_mail_formatter_format_header (
- formatter, str, CAMEL_MEDIUM (part->part), &raw_header,
+ formatter, str,
+ CAMEL_MEDIUM (part->part), &raw_header,
E_MAIL_FORMATTER_HEADER_FLAG_BOLD |
E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS, "UTF-8");
g_free (raw_header.value);