aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-04-17 21:24:26 +0800
committerMilan Crha <mcrha@redhat.com>2012-04-17 21:24:26 +0800
commit9e541010cb509af8b6feee624d782a158308ed01 (patch)
treee4abcb7fa642db3fd2e175fcf4b9c940b959941d /libemail-engine
parentabf229bec3edbe60750c2d90a3b40bcebd56710a (diff)
downloadgsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.tar
gsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.tar.gz
gsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.tar.bz2
gsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.tar.lz
gsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.tar.xz
gsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.tar.zst
gsoc2013-evolution-9e541010cb509af8b6feee624d782a158308ed01.zip
Bug #667046 - Outgoing filter cannot override used Sent folder
Diffstat (limited to 'libemail-engine')
-rw-r--r--libemail-engine/e-mail-session-utils.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c
index 6aa090e0e4..27373f1610 100644
--- a/libemail-engine/e-mail-session-utils.c
+++ b/libemail-engine/e-mail-session-utils.c
@@ -506,6 +506,9 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
error->message);
g_clear_error (&error);
}
+
+ if ((camel_message_info_flags (context->info) & CAMEL_MESSAGE_DELETED) != 0)
+ copy_to_sent = FALSE;
}
if (!copy_to_sent)
@@ -632,6 +635,23 @@ exit:
g_string_free (error_messages, TRUE);
}
+static guint32
+get_message_size (CamelMimeMessage *message,
+ GCancellable *cancellable)
+{
+ guint32 res = 0;
+ CamelStream *null;
+
+ g_return_val_if_fail (message != NULL, 0);
+
+ null = camel_stream_null_new ();
+ camel_data_wrapper_write_to_stream_sync (CAMEL_DATA_WRAPPER (message), null, cancellable, NULL);
+ res = CAMEL_STREAM_NULL (null)->written;
+ g_object_unref (null);
+
+ return res;
+}
+
void
e_mail_session_send_to (EMailSession *session,
CamelMimeMessage *message,
@@ -758,7 +778,8 @@ e_mail_session_send_to (EMailSession *session,
/* Miscellaneous preparations. */
- info = camel_message_info_new (NULL);
+ info = camel_message_info_new_from_header (NULL, ((CamelMimePart *) message)->headers);
+ ((CamelMessageInfoBase *) info)->size = get_message_size (message, cancellable);
camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, ~0);
/* The rest of the processing happens in a thread. */