2005-08-10 [colin] 1.9.13cvs31
authorColin Leroy <colin@colino.net>
Wed, 10 Aug 2005 08:43:13 +0000 (08:43 +0000)
committerColin Leroy <colin@colino.net>
Wed, 10 Aug 2005 08:43:13 +0000 (08:43 +0000)
* src/procmsg.c
Fix procmsg_msginfo_new_from_mimeinfo() when
the MimeInfo isn't stored in memory. This fixes
replying to an attached message.

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/procmsg.c

index 9c91baf80fef0754b52a4c8718b2619a8818f1eb..e6be0e7cbef65b17c3e026cb1a2925d612d28bc7 100644 (file)
@@ -1,3 +1,10 @@
+2005-08-10 [colin]     1.9.13cvs31
+
+       * src/procmsg.c
+               Fix procmsg_msginfo_new_from_mimeinfo() when
+               the MimeInfo isn't stored in memory. This fixes
+               replying to an attached message.
+
 2005-08-10 [colin]     1.9.13cvs30
 
        * src/mainwindow.c
index ff4f237821ab6f8132e4bef8b98477e8b42dd78a..346417c2f213285d5ac70a93ca5b765f1a60faf6 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.108 -r 1.395.2.109 src/summaryview.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/prefs_summaries.c;  ) > 1.9.13cvs28.patchset
 ( cvs diff -u -r 1.213.2.49 -r 1.213.2.50 src/folder.c;  cvs diff -u -r 1.3.2.6 -r 1.3.2.7 src/folderutils.c;  cvs diff -u -r 1.207.2.55 -r 1.207.2.56 src/folderview.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/imap_gtk.c;  cvs diff -u -r 1.274.2.53 -r 1.274.2.54 src/mainwindow.c;  cvs diff -u -r 1.2.2.10 -r 1.2.2.11 src/mh_gtk.c;  cvs diff -u -r 1.150.2.34 -r 1.150.2.35 src/procmsg.c;  cvs diff -u -r 1.395.2.109 -r 1.395.2.110 src/summaryview.c;  ) > 1.9.13cvs29.patchset
 ( cvs diff -u -r 1.274.2.54 -r 1.274.2.55 src/mainwindow.c;  ) > 1.9.13cvs30.patchset
+( cvs diff -u -r 1.150.2.35 -r 1.150.2.36 src/procmsg.c;  ) > 1.9.13cvs31.patchset
index 52942d6fe54b7cc25e3defb8cb7df9f14a6929f9..ae602757e7ac8c79222eb3a698d609083a50c154 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=30
+EXTRA_VERSION=31
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4f2235027e3279e3f72a8e5e5d44cbf06da86ead..16ff841327c8d63196b89fabd80f3145cd8958c1 100644 (file)
@@ -1886,16 +1886,31 @@ MsgInfo *procmsg_msginfo_new_from_mimeinfo(MsgInfo *src_msginfo, MimeInfo *mimei
                mimeinfo->content = MIMECONTENT_FILE;
                mimeinfo->data.filename = g_strdup(tmpfile);
                g_free(tmpfile);
-       }
-
-       tmp_msginfo = procheader_parse_file(mimeinfo->data.filename,
-                               flags, TRUE, FALSE);
-
-       if (tmp_msginfo != NULL) {
-               tmp_msginfo->folder = src_msginfo->folder;
-               tmp_msginfo->plaintext_file = g_strdup(mimeinfo->data.filename);
+               tmp_msginfo = procheader_parse_file(mimeinfo->data.filename,
+                                       flags, TRUE, FALSE);
+               if (tmp_msginfo != NULL) {
+                       tmp_msginfo->folder = src_msginfo->folder;
+                       tmp_msginfo->plaintext_file = g_strdup(mimeinfo->data.filename);
+               } else {
+                       g_warning("procmsg_msginfo_new_from_mimeinfo(): Can't generate new msginfo");
+               }
        } else {
-               g_warning("procmsg_msginfo_new_from_mimeinfo(): Can't generate new msginfo");
+               gchar *tmpfile = get_tmp_file();
+               FILE *fp = fopen(tmpfile, "wb");
+               if (fp && procmime_write_message_rfc822(mimeinfo, fp) >= 0) {
+                       tmp_msginfo = procheader_parse_file(
+                               tmpfile, flags, TRUE, FALSE);
+               }
+               if (fp)
+                       fclose(fp);
+               if (tmp_msginfo != NULL) {
+                       tmp_msginfo->folder = src_msginfo->folder;
+                       tmp_msginfo->plaintext_file = g_strdup(tmpfile);
+               } else {
+                       g_warning("procmsg_msginfo_new_from_mimeinfo(): Can't generate new msginfo");
+               }
+               g_free(tmpfile);
+               
        }
        
        return tmp_msginfo;