[evolution] Bug 769388 - Add option to not display Content-Disposition:inline parts
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 769388 - Add option to not display Content-Disposition:inline parts
- Date: Wed, 3 Aug 2016 12:43:57 +0000 (UTC)
commit a48c080b2001a7f547b1e47334b11e7bc97235d1
Author: Leonard den Ottolander <bugzilla ottolander nl>
Date: Wed Aug 3 14:43:50 2016 +0200
Bug 769388 - Add option to not display Content-Disposition:inline parts
data/org.gnome.evolution.mail.gschema.xml.in | 5 +++++
em-format/e-mail-part-utils.c | 10 +++++++++-
em-format/e-mail-part.c | 9 +++++++--
3 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index 24d18e0..4c91054 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -200,6 +200,11 @@
<_summary>Wrap quoted text in replies</_summary>
<_description>If set to 'true' quoted text in replies will be wrapped.</_description>
</key>
+ <key name="display-content-disposition-inline" type="b">
+ <default>true</default>
+ <_summary>Whether to obey Content-Disposition:inline message header hint</_summary>
+ <_description>Set to 'false' to block automatic display of attachments with Content-Disposition:
inline.</_description>
+ </key>
<key name="drag-and-drop-save-file-format" type="s">
<default>'mbox'</default>
<_summary>Save file format for drag-and-drop operation</_summary>
diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c
index 4a6ef40..b0899ee 100644
--- a/em-format/e-mail-part-utils.c
+++ b/em-format/e-mail-part-utils.c
@@ -584,8 +584,16 @@ e_mail_part_is_inline (CamelMimePart *mime_part,
disposition = camel_mime_part_get_disposition (mime_part);
- if (disposition != NULL)
+ if (disposition != NULL) {
is_inline = (g_ascii_strcasecmp (disposition, "inline") == 0);
+ if (is_inline) {
+ GSettings *settings;
+
+ settings = e_util_ref_settings ("org.gnome.evolution.mail");
+ is_inline = g_settings_get_boolean (settings, "display-content-disposition-inline");
+ g_clear_object (&settings);
+ }
+ }
if ((extensions == NULL) || g_queue_is_empty (extensions))
return is_inline;
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index 687ac9d..432481c 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -526,8 +526,13 @@ e_mail_part_should_show_inline (EMailPart *part)
disposition = camel_mime_part_get_content_disposition (mime_part);
if (disposition && disposition->disposition &&
- g_ascii_strncasecmp (disposition->disposition, "inline", 6) == 0)
- res = TRUE;
+ g_ascii_strncasecmp (disposition->disposition, "inline", 6) == 0) {
+ GSettings *settings;
+
+ settings = e_util_ref_settings ("org.gnome.evolution.mail");
+ res = g_settings_get_boolean (settings, "display-content-disposition-inline");
+ g_clear_object (&settings);
+ }
g_object_unref (mime_part);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]