[evolution-data-server/gnome-3-20] Bug 767056 - [IMAPx] Calculate message size on Append when not known



commit 874391b8f2e91cb1b12956c1aaab8dd94b43b14b
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 31 15:30:37 2016 +0200

    Bug 767056 - [IMAPx] Calculate message size on Append when not known

 camel/providers/imapx/camel-imapx-server.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index ce39489..8cbd23d 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4571,6 +4571,16 @@ camel_imapx_server_append_message_sync (CamelIMAPXServer *is,
                }
        }
 
+       if (!camel_message_info_size (info)) {
+               CamelStreamNull *sn = (CamelStreamNull *) camel_stream_null_new ();
+
+               camel_data_wrapper_write_to_stream_sync (
+                       CAMEL_DATA_WRAPPER (message),
+                       CAMEL_STREAM (sn), NULL, NULL);
+               ((CamelMessageInfoBase *) info)->size = sn->written;
+               g_object_unref (sn);
+       }
+
        g_free (uid);
 
        if (camel_mime_message_has_attachment (message))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]