[evolution] Bug 778065 - Add hidden option to keep original signature in replies



commit 7c1385fd613e3318b0b080e74c1a13d0b8f1b3cb
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jan 31 12:32:17 2018 +0100

    Bug 778065 - Add hidden option to keep original signature in replies

 data/org.gnome.evolution.mail.gschema.xml.in |    5 +++++
 src/mail/em-composer-utils.c                 |   12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index 53f7c5b..24f997c 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -175,6 +175,11 @@
       <_summary>Do not add signature delimiter</_summary>
       <_description>Set to TRUE in case you do not want to add signature delimiter before your signature 
when composing a mail.</_description>
     </key>
+    <key name="composer-reply-keep-signature" type="b">
+      <default>false</default>
+      <_summary>Keep original message signature in replies</_summary>
+      <_description>When set to TRUE, keep original message signature in replies, otherwise strip the 
signature and everything below it when replying to the message.</_description>
+    </key>
     <key name="composer-ignore-list-reply-to" type="b">
       <default>false</default>
       <_summary>Ignore list Reply-To:</_summary>
diff --git a/src/mail/em-composer-utils.c b/src/mail/em-composer-utils.c
index 0296976..7ab04b4 100644
--- a/src/mail/em-composer-utils.c
+++ b/src/mail/em-composer-utils.c
@@ -3444,7 +3444,13 @@ composer_set_body (EMsgComposer *composer,
        gchar *text, *credits, *original;
        CamelMimePart *part;
        CamelSession *session;
-       guint32 validity_found = 0;
+       GSettings *settings;
+       guint32 validity_found = 0, keep_sig_flag = 0;
+
+       settings = e_util_ref_settings ("org.gnome.evolution.mail");
+       if (g_settings_get_boolean (settings, "composer-reply-keep-signature"))
+               keep_sig_flag = E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG;
+       g_clear_object (&settings);
 
        session = e_msg_composer_ref_session (composer);
 
@@ -3461,7 +3467,7 @@ composer_set_body (EMsgComposer *composer,
        case E_MAIL_REPLY_STYLE_OUTLOOK:
                original = quoting_text (QUOTING_ORIGINAL);
                text = em_utils_message_to_html (
-                       session, message, original, E_MAIL_FORMATTER_QUOTE_FLAG_HEADERS,
+                       session, message, original, E_MAIL_FORMATTER_QUOTE_FLAG_HEADERS | keep_sig_flag,
                        parts_list, NULL, NULL, &validity_found);
                e_msg_composer_set_body_text (composer, text, TRUE);
                g_free (text);
@@ -3474,7 +3480,7 @@ composer_set_body (EMsgComposer *composer,
                /* do what any sane user would want when replying... */
                credits = attribution_format (message);
                text = em_utils_message_to_html (
-                       session, message, credits, E_MAIL_FORMATTER_QUOTE_FLAG_CITE,
+                       session, message, credits, E_MAIL_FORMATTER_QUOTE_FLAG_CITE | keep_sig_flag,
                        parts_list, NULL, NULL, &validity_found);
                g_free (credits);
                e_msg_composer_set_body_text (composer, text, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]