From 0c65652f2a3b29250b11425c594ded737a2a4cc5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 22 Oct 2012 15:28:01 +0200 Subject: Bug #268618 - Add: Save replies in the folder of the message being replied to Follow-up fixes: a) don't copy to origin folder for forwarded messages b) use a real folder when reply/forward from a vFolder --- libemail-engine/e-mail-session-utils.c | 11 +++++++---- libemail-engine/mail-ops.c | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'libemail-engine') diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c index 33e7effa47..7ec3ca3a70 100644 --- a/libemail-engine/e-mail-session-utils.c +++ b/libemail-engine/e-mail-session-utils.c @@ -863,10 +863,13 @@ e_mail_session_send_to (EMailSession *session, transport_uid = g_strstrip (g_strdup (string)); if (replies_to_origin_folder) { - string = camel_header_raw_find (&xev, "X-Evolution-Source-Folder", NULL); - if (string != NULL && camel_header_raw_find (&xev, "X-Evolution-Source-Message", NULL) != NULL) { - g_free (sent_folder_uri); - sent_folder_uri = g_strstrip (g_strdup (string)); + string = camel_header_raw_find (&xev, "X-Evolution-Source-Flags", NULL); + if (string != NULL && strstr (string, "FORWARDED") == NULL) { + string = camel_header_raw_find (&xev, "X-Evolution-Source-Folder", NULL); + if (string != NULL && camel_header_raw_find (&xev, "X-Evolution-Source-Message", NULL) != NULL) { + g_free (sent_folder_uri); + sent_folder_uri = g_strstrip (g_strdup (string)); + } } } diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c index e24e8c9752..748152602c 100644 --- a/libemail-engine/mail-ops.c +++ b/libemail-engine/mail-ops.c @@ -623,10 +623,13 @@ mail_send_message (struct _send_queue_msg *m, sent_folder_uri = g_strstrip (g_strdup (tmp)); if (replies_to_origin_folder) { - tmp = camel_header_raw_find (&xev, "X-Evolution-Source-Folder", NULL); - if (tmp != NULL && camel_header_raw_find (&xev, "X-Evolution-Source-Message", NULL) != NULL) { - g_free (sent_folder_uri); - sent_folder_uri = g_strstrip (g_strdup (tmp)); + tmp = camel_header_raw_find (&xev, "X-Evolution-Source-Flags", NULL); + if (tmp != NULL && strstr (tmp, "FORWARDED") == NULL) { + tmp = camel_header_raw_find (&xev, "X-Evolution-Source-Folder", NULL); + if (tmp != NULL && camel_header_raw_find (&xev, "X-Evolution-Source-Message", NULL) != NULL) { + g_free (sent_folder_uri); + sent_folder_uri = g_strstrip (g_strdup (tmp)); + } } } -- cgit v1.2.3