2004-11-05 [colin] 0.9.12cvs139.1
authorColin Leroy <colin@colino.net>
Fri, 5 Nov 2004 16:25:22 +0000 (16:25 +0000)
committerColin Leroy <colin@colino.net>
Fri, 5 Nov 2004 16:25:22 +0000 (16:25 +0000)
* src/compose.c
* src/procmime.c
Sync with HEAD

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c
src/procmime.c

index 71a3159df7f02dd9c1ed268e7d56f63b14c9de98..ca9a77e282d93e66a61b1f667f927bd30e3345ca 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-05 [colin]     0.9.12cvs139.1
+
+       * src/compose.c
+       * src/procmime.c
+               Sync with HEAD
+
 2004-11-03 [paul]      0.9.12cvs138.1
 
        * ChangeLog.claws
index bc264e2f1a9d69991bbd3eda1f7f67c52e181603..e910d54f77b0608591f03cb80a0c5829c5d378c0 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.36.2.12 -r 1.36.2.13 src/common/utils.c; ) > 0.9.12cvs136.1.patchset
 ( cvs diff -u -r 1.49.2.14 -r 1.49.2.15 src/procmime.c; ) > 0.9.12cvs136.2.patchset
 ( cvs diff -u -r 1.2504.2.28 -r 1.2504.2.29 ChangeLog.claws; cvs diff -u -r 1.654.2.247 -r 1.654.2.248 configure.ac; cvs diff -u -r 1.53.2.7 -r 1.53.2.8 po/POTFILES.in; cvs diff -u -r 1.3.2.2 -r 1.3.2.3 src/prefs_ext_prog.c; cvs diff -u -r 1.49.2.15 -r 1.49.2.16 src/procmime.c; cvs diff -u -r 1.2.2.2 -r 1.2.2.3 tools/kdeservicemenu/README; cvs diff -u -r 1.3.2.1 -r 1.3.2.2 tools/kdeservicemenu/template_sylpheed-attach-files.desktop; cvs diff -u -r 1.3.2.1 -r 1.3.2.2 tools/kdeservicemenu/template_sylpheed-compress-attach.desktop; ) > 0.9.12cvs138.1.patchset
+( cvs diff -u -r 1.382.2.57 -r 1.382.2.58 src/compose.c; cvs diff -u -r 1.49.2.16 -r 1.49.2.17 src/procmime.c; ) > 0.9.12cvs139.1.patchset
index da63e550e8bf2453b412d01dc4184f2a609fd431..f4f32e026814e0c6e9173e981647fb7e5ce1e538 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=138
+EXTRA_VERSION=139
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=.1
 
index 0b7e8d1a82ad98b9b14b8b97ec6bbed49b4fd472..4dfddc1f071230f2fb3874ef32569bcda843769e 100644 (file)
@@ -3596,9 +3596,11 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
        mimetext->data.mem = buf;
        mimetext->type = MIMETYPE_TEXT;
        mimetext->subtype = g_strdup("plain");
+       if (encoding != ENC_UNKNOWN)
+               procmime_encode_content(mimetext, encoding);
+
        g_hash_table_insert(mimetext->typeparameters, g_strdup("charset"),
                            g_strdup(out_codeset));
-       /* procmime_encode_content(mimetext, encoding); */
 
        /* append attachment parts */
        if (compose_use_attach(compose)) {
index 1b565c0779ce780377b61713c494ad38a4ea993c..d28318181a92f2265d11b506cd8336c0f5363d6c 100644 (file)
@@ -369,12 +369,12 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
 {
        FILE *infp, *outfp;
        gint len;
-       gchar *tmpfilename;
+       gchar *tmpfilename, *tmpout;
        struct stat statbuf;
 
-       if (mimeinfo->encoding_type != ENC_UNKNOWN ||
-           mimeinfo->encoding_type != ENC_BINARY ||
-           mimeinfo->encoding_type != ENC_7BIT ||
+       if (mimeinfo->encoding_type != ENC_UNKNOWN &&
+           mimeinfo->encoding_type != ENC_BINARY &&
+           mimeinfo->encoding_type != ENC_7BIT &&
            mimeinfo->encoding_type != ENC_8BIT)
                if(!procmime_decode_content(mimeinfo))
                        return FALSE;
@@ -385,8 +385,26 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
                return FALSE;
        }
 
+       if (mimeinfo->content == MIMECONTENT_MEM) {
+               infp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpout);
+               if (infp)
+                       fclose(infp);
+               else
+                       return FALSE;
+
+               str_write_to_file(mimeinfo->data.mem, tmpout);
+               g_free(mimeinfo->data.mem);
+               mimeinfo->tmp = TRUE;
+               mimeinfo->data.filename = tmpout;
+       }
+
        if ((infp = fopen(mimeinfo->data.filename, "rb")) == NULL) {
                g_warning("Can't open file %s\n", mimeinfo->data.filename);
+               if (mimeinfo->content == MIMECONTENT_MEM) {
+                       unlink(mimeinfo->data.filename);
+                       g_free(mimeinfo->data.filename);
+                       mimeinfo->data.filename = NULL;
+               }
                return FALSE;
        }
 
@@ -433,6 +451,7 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
        mimeinfo->offset = 0;
        mimeinfo->length = statbuf.st_size;
        mimeinfo->encoding_type = encoding;
+       mimeinfo->content = MIMECONTENT_FILE;
 
        return TRUE;
 }