Commit 8d6d8d08 authored by Milan Crha's avatar Milan Crha

I#154 - Mail signature is changed when reopening an email in the Drafts/Outbox

Closes GNOME/evolution#154
parent da0a7804
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment