aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/local/camel-local-summary.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index a1f1c1334b..c925e6e36a 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -33,7 +33,8 @@
#include <stdlib.h>
#include "camel-local-summary.h"
-#include <camel/camel-mime-message.h>
+#include "camel/camel-mime-message.h"
+#include "camel/camel-stream-null.h"
#define io(x)
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
@@ -393,8 +394,19 @@ local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMess
}
mi->flags = mi->flags | (info->flags & 0xffff);
- mi->size = info->size;
+ if (info->size)
+ mi->size = info->size;
}
+
+ /* we need to calculate the size ourselves */
+ if (mi->size == 0) {
+ CamelStreamNull *sn = (CamelStreamNull *)camel_stream_null_new();
+
+ camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, (CamelStream *)sn);
+ mi->size = sn->written;
+ camel_object_unref((CamelObject *)sn);
+ }
+
mi->flags &= ~(CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED);
xev = camel_local_summary_encode_x_evolution(cls, mi);
camel_medium_set_header((CamelMedium *)msg, "X-Evolution", xev);