[evolution/wip/webkit2] Bug 767780 - The "References" header folded twice
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] Bug 767780 - The "References" header folded twice
- Date: Wed, 29 Jun 2016 15:07:14 +0000 (UTC)
commit f10de1fdba8f73b02d131fecefc7c818fb22f20f
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 21 10:26:52 2016 +0200
Bug 767780 - The "References" header folded twice
composer/e-msg-composer.c | 2 +-
mail/em-composer-utils.c | 15 +++++++++++----
modules/mdn/evolution-mdn.c | 19 +++++++++++--------
3 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 2631f16..049c150 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3762,7 +3762,7 @@ e_msg_composer_new_with_message (EShell *shell,
g_strdup (headers->name));
g_ptr_array_add (
composer->priv->extra_hdr_values,
- g_strdup (headers->value));
+ camel_header_unfold (headers->value));
}
headers = headers->next;
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index bc24b58..a9441c9 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1998,6 +1998,7 @@ emu_add_composer_references_from_message (EMsgComposer *composer,
GString *references = g_string_new ("");
gint ii = 0;
const gchar *value;
+ gchar *unfolded;
while (value = e_msg_composer_get_header (composer, "References", ii), value) {
ii++;
@@ -2018,9 +2019,12 @@ emu_add_composer_references_from_message (EMsgComposer *composer,
if (*message_id_header != '<')
g_string_append_c (references, '>');
- e_msg_composer_set_header (composer, "References", references->str);
+ unfolded = camel_header_unfold (references->str);
+
+ e_msg_composer_set_header (composer, "References", unfolded);
g_string_free (references, TRUE);
+ g_free (unfolded);
}
}
@@ -2463,7 +2467,7 @@ reply_get_composer (EShell *shell,
const gchar *message_uid,
CamelNNTPAddress *postto)
{
- const gchar *message_id, *references;
+ gchar *message_id, *references;
EDestination **tov, **ccv;
EMsgComposer *composer;
EComposerHeaderTable *table;
@@ -2552,8 +2556,8 @@ reply_get_composer (EShell *shell,
/* Add In-Reply-To and References. */
medium = CAMEL_MEDIUM (message);
- message_id = camel_medium_get_header (medium, "Message-ID");
- references = camel_medium_get_header (medium, "References");
+ message_id = camel_header_unfold (camel_medium_get_header (medium, "Message-ID"));
+ references = camel_header_unfold (camel_medium_get_header (medium, "References"));
if (message_id != NULL) {
gchar *reply_refs;
@@ -2576,6 +2580,9 @@ reply_get_composer (EShell *shell,
composer, "References", references);
}
+ g_free (message_id);
+ g_free (references);
+
return composer;
}
diff --git a/modules/mdn/evolution-mdn.c b/modules/mdn/evolution-mdn.c
index 0a46204..27b9711 100644
--- a/modules/mdn/evolution-mdn.c
+++ b/modules/mdn/evolution-mdn.c
@@ -222,8 +222,8 @@ mdn_notify_sender (ESource *identity_source,
EMailBackend *backend;
EMailSession *session;
ESourceExtension *extension;
- const gchar *message_id;
- const gchar *message_date;
+ gchar *message_id;
+ gchar *message_date;
const gchar *message_subject;
const gchar *extension_name;
const gchar *transport_uid;
@@ -236,6 +236,8 @@ mdn_notify_sender (ESource *identity_source,
gchar *content;
gchar *ua;
+ g_return_if_fail (identity_source != NULL);
+
backend = e_mail_reader_get_backend (reader);
session = e_mail_backend_get_session (backend);
@@ -245,20 +247,18 @@ mdn_notify_sender (ESource *identity_source,
camel_message_info_set_user_flag (info, MDN_USER_FLAG, TRUE);
medium = CAMEL_MEDIUM (message);
- message_id = camel_medium_get_header (medium, "Message-ID");
- message_date = camel_medium_get_header (medium, "Date");
+ message_id = camel_header_unfold (camel_medium_get_header (medium, "Message-ID"));
+ message_date = camel_header_unfold (camel_medium_get_header (medium, "Date"));
message_subject = camel_mime_message_get_subject (message);
if (message_id == NULL)
- message_id = "";
+ message_id = g_strdup ("");
if (message_date == NULL)
- message_date = "";
+ message_date = g_strdup ("");
/* Collect information for the receipt. */
- g_return_if_fail (identity_source != NULL);
-
extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;
extension = e_source_get_extension (identity_source, extension_name);
@@ -416,6 +416,9 @@ mdn_notify_sender (ESource *identity_source,
g_object_ref (session));
camel_message_info_unref (receipt_info);
+
+ g_free (message_date);
+ g_free (message_id);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]