[evolution] Bug #667046 - Outgoing filter cannot override used Sent folder
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug #667046 - Outgoing filter cannot override used Sent folder
- Date: Tue, 17 Apr 2012 13:25:15 +0000 (UTC)
commit 9e541010cb509af8b6feee624d782a158308ed01
Author: Milan Crha <mcrha redhat com>
Date: Tue Apr 17 15:24:26 2012 +0200
Bug #667046 - Outgoing filter cannot override used Sent folder
libemail-engine/e-mail-session-utils.c | 23 ++++++++++++++++++++++-
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 6aa090e..27373f1 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. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]