aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine/mail-ops.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-10-19 01:44:35 +0800
committerMilan Crha <mcrha@redhat.com>2012-10-19 01:44:35 +0800
commitbf8eaa185a845fc1118b3ebd9ad474a0de58abf6 (patch)
tree443c542b2485e04c42eb202906882f94bda97129 /libemail-engine/mail-ops.c
parentb3ec9c8c2f6d4711b1fbd710891de01ab81500b6 (diff)
downloadgsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.tar
gsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.tar.gz
gsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.tar.bz2
gsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.tar.lz
gsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.tar.xz
gsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.tar.zst
gsoc2013-evolution-bf8eaa185a845fc1118b3ebd9ad474a0de58abf6.zip
Bug #268618 - Add: Save replies in the folder of the message being replied to
Diffstat (limited to 'libemail-engine/mail-ops.c')
-rw-r--r--libemail-engine/mail-ops.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index 115c2c7bd2..e24e8c9752 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -527,7 +527,8 @@ static gboolean
get_submission_details_from_identity (EMailSession *session,
const gchar *identity_uid,
gchar **out_transport_uid,
- gchar **out_sent_folder_uri)
+ gchar **out_sent_folder_uri,
+ gboolean *out_replies_to_origin_folder)
{
ESource *source;
ESourceRegistry *registry;
@@ -556,6 +557,10 @@ get_submission_details_from_identity (EMailSession *session,
e_source_mail_submission_dup_transport_uid (
E_SOURCE_MAIL_SUBMISSION (extension));
+ *out_replies_to_origin_folder =
+ e_source_mail_submission_get_replies_to_origin_folder (
+ E_SOURCE_MAIL_SUBMISSION (extension));
+
g_object_unref (source);
return TRUE;
@@ -579,6 +584,7 @@ mail_send_message (struct _send_queue_msg *m,
gchar *transport_uid = NULL;
gchar *sent_folder_uri = NULL;
const gchar *resent_from, *tmp;
+ gboolean replies_to_origin_folder = FALSE;
CamelFolder *folder = NULL;
GString *err = NULL;
struct _camel_header_raw *xev, *header;
@@ -603,7 +609,8 @@ mail_send_message (struct _send_queue_msg *m,
identity_uid = g_strstrip (g_strdup (tmp));
get_submission_details_from_identity (
m->session, identity_uid,
- &transport_uid, &sent_folder_uri);
+ &transport_uid, &sent_folder_uri,
+ &replies_to_origin_folder);
g_free (identity_uid);
}
@@ -615,6 +622,14 @@ mail_send_message (struct _send_queue_msg *m,
if (sent_folder_uri == NULL && tmp != NULL)
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));
+ }
+ }
+
service = camel_session_ref_service (
CAMEL_SESSION (m->session), transport_uid);
if (service != NULL)