[evolution] I#154 - Mail signature is changed when reopening an email in the Drafts/Outbox
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] I#154 - Mail signature is changed when reopening an email in the Drafts/Outbox
- Date: Tue, 27 Nov 2018 13:26:59 +0000 (UTC)
commit 8d6d8d08db85549347b91ae11d4389d2bd02f147
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 27 14:25:37 2018 +0100
I#154 - Mail signature is changed when reopening an email in the Drafts/Outbox
Closes https://gitlab.gnome.org/GNOME/evolution/issues/154
src/composer/e-composer-private.c | 22 ++++++++++++++++++++--
src/composer/e-msg-composer.c | 8 ++++++++
2 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/src/composer/e-composer-private.c b/src/composer/e-composer-private.c
index 66d6605a94..8b6b8b4625 100644
--- a/src/composer/e-composer-private.c
+++ b/src/composer/e-composer-private.c
@@ -808,8 +808,26 @@ composer_load_signature_cb (EMailSignatureComboBox *combo_box,
&composer->priv->check_if_signature_is_changed,
&composer->priv->ignore_next_signature_change);
- if (new_signature_id && *new_signature_id)
- gtk_combo_box_set_active_id (GTK_COMBO_BOX (combo_box), new_signature_id);
+ if (new_signature_id && *new_signature_id) {
+ gboolean been_ignore = composer->priv->ignore_next_signature_change;
+ gboolean signature_changed = g_strcmp0 (gtk_combo_box_get_active_id (GTK_COMBO_BOX
(combo_box)), new_signature_id) != 0;
+
+ composer->priv->ignore_next_signature_change = been_ignore && signature_changed;
+
+ if (!gtk_combo_box_set_active_id (GTK_COMBO_BOX (combo_box), new_signature_id)) {
+ signature_changed = g_strcmp0 (gtk_combo_box_get_active_id (GTK_COMBO_BOX
(combo_box)), "none") != 0;
+
+ composer->priv->ignore_next_signature_change = been_ignore && signature_changed;
+
+ gtk_combo_box_set_active_id (GTK_COMBO_BOX (combo_box), "none");
+ }
+
+ if (!signature_changed && composer->priv->check_if_signature_is_changed) {
+ composer->priv->set_signature_from_message = FALSE;
+ composer->priv->check_if_signature_is_changed = FALSE;
+ composer->priv->ignore_next_signature_change = FALSE;
+ }
+ }
g_free (new_signature_id);
g_free (contents);
diff --git a/src/composer/e-msg-composer.c b/src/composer/e-msg-composer.c
index 06be5079e5..39f1d3fe47 100644
--- a/src/composer/e-msg-composer.c
+++ b/src/composer/e-msg-composer.c
@@ -3661,6 +3661,7 @@ e_msg_composer_setup_with_message (EMsgComposer *composer,
gint len, i;
guint jj, jjlen;
gboolean is_message_from_draft = FALSE;
+ gboolean is_editor_ready;
#ifdef ENABLE_SMIME
CamelMimePart *decrypted_part = NULL;
#endif
@@ -4059,6 +4060,8 @@ e_msg_composer_setup_with_message (EMsgComposer *composer,
priv->set_signature_from_message = TRUE;
+ is_editor_ready = e_content_editor_is_ready (cnt_editor);
+
/* We wait until now to set the body text because we need to
* ensure that the attachment bar has all the attachments before
* we request them. */
@@ -4066,6 +4069,11 @@ e_msg_composer_setup_with_message (EMsgComposer *composer,
set_signature_gui (composer);
+ /* This makes sure the signature is used from the real message body,
+ not from the empty body when the composer is in the HTML mode */
+ if (!is_editor_ready)
+ priv->set_signature_from_message = TRUE;
+
#ifdef ENABLE_SMIME
g_clear_object (&decrypted_part);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]