aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-attachment-bar.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-11 04:12:40 +0800
committerDan Winship <danw@src.gnome.org>2000-05-11 04:12:40 +0800
commit497516ec005a8c27065e003093be6d18470fc58d (patch)
treecf9887fae066c5c69e6ec56cdf3783de06155ff8 /composer/e-msg-composer-attachment-bar.c
parentc3d51050bba8ab55f6acb58510c81284063ab55e (diff)
downloadgsoc2013-evolution-497516ec005a8c27065e003093be6d18470fc58d.tar.gz
gsoc2013-evolution-497516ec005a8c27065e003093be6d18470fc58d.tar.zst
gsoc2013-evolution-497516ec005a8c27065e003093be6d18470fc58d.zip
deal with Content-Transfer-Encoding a little bit at least.
* e-msg-composer-attachment-bar.c (attach_to_multipart): deal with Content-Transfer-Encoding a little bit at least. svn path=/trunk/; revision=2977
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r--composer/e-msg-composer-attachment-bar.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index 57eb2d42b6..5041164d9b 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -608,12 +608,11 @@ attach_to_multipart (CamelMultipart *multipart,
CamelMimePart *part;
struct stat st;
int fd;
+ char *data;
part = camel_mime_part_new ();
fd = open (attachment->file_name, O_RDONLY);
if (fd != -1 && fstat (fd, &st) != -1) {
- char *data;
-
data = g_malloc (st.st_size);
read (fd, data, st.st_size);
close (fd);
@@ -631,6 +630,16 @@ attach_to_multipart (CamelMultipart *multipart,
g_basename (attachment->file_name));
camel_mime_part_set_description (part, attachment->description);
+ /* Kludge a bit on CTE. For now, we set QP for text/ and message/
+ * and B64 for all else. FIXME.
+ */
+
+ if (!strncasecmp (attachment->mime_type, "text/", 5) ||
+ !strncasecmp (attachment->mime_type, "message/", 8))
+ camel_mime_part_set_encoding (part, CAMEL_MIME_PART_ENCODING_QUOTEDPRINTABLE);
+ else
+ camel_mime_part_set_encoding (part, CAMEL_MIME_PART_ENCODING_BASE64);
+
camel_multipart_add_part (multipart, part);
gtk_object_unref (GTK_OBJECT (part));
}