aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-08 13:24:54 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-08 13:24:54 +0800
commitb7f49ccf5755b1073d13348849cc71f67ba92a0d (patch)
treee81e979778fe6b8940a42dd8860a548da1058479 /camel/camel-mime-part.c
parent4b0541ac3358b6f094bac4f9d1f3e415e23fd4d5 (diff)
downloadgsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.tar
gsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.tar.gz
gsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.tar.bz2
gsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.tar.lz
gsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.tar.xz
gsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.tar.zst
gsoc2013-evolution-b7f49ccf5755b1073d13348849cc71f67ba92a0d.zip
Merged NEW_SUMMARY branch back to trunk, and resolved conflicts.
2000-05-08 NotZed <NotZed@HelixCode.com> * Merged NEW_SUMMARY branch back to trunk, and resolved conflicts. * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_update): Return status. * camel-stream-filter.c (do_close): We NEED a stream close. svn path=/trunk/; revision=2906
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 7d08c6a5b1..1688168737 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -34,6 +34,8 @@
#include <ctype.h>
#include "camel-mime-parser.h"
#include "camel-stream-mem.h"
+#include "camel-stream-filter.h"
+#include "camel-mime-filter-basic.h"
#define d(x)
@@ -184,6 +186,8 @@ finalize (GtkObject *object)
if (mime_part->content_input_stream) gtk_object_unref (GTK_OBJECT (mime_part->content_input_stream));
+ header_raw_clear(&mime_part->headers);
+
GTK_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -503,9 +507,37 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
content = camel_medium_get_content_object (medium);
if (content) {
+ /* I dont really like this here, but i dont know where else it might go ... */
+#define CAN_THIS_GO_ELSEWHERE
+#ifdef CAN_THIS_GO_ELSEWHERE
+ CamelMimeFilter *filter = NULL;
+ CamelStreamFilter *filter_stream = NULL;
+
+ switch(mp->encoding) {
+ case CAMEL_MIME_PART_ENCODING_BASE64:
+ filter = (CamelMimeFilter *)camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_BASE64_ENC);
+ break;
+ case CAMEL_MIME_PART_ENCODING_QUOTEDPRINTABLE:
+ filter = (CamelMimeFilter *)camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_QP_ENC);
+ break;
+ default:
+ break;
+ }
+ if (filter) {
+ gtk_object_ref((GtkObject *)stream);
+ filter_stream = camel_stream_filter_new_with_stream(stream);
+ camel_stream_filter_add(filter_stream, filter);
+ stream = (CamelStream *)filter_stream;
+ }
+
+#endif
if ( (count = camel_data_wrapper_write_to_stream(content, stream)) == -1 )
- return -1;
- total += count;
+ total = -1;
+ else
+ total += count;
+
+ if (filter_stream)
+ gtk_object_unref((GtkObject *)filter_stream);
} else {
g_warning("No content for medium, nothing to write");
}