]> granicus.if.org Git - neomutt/commitdiff
Fix encoder mode for text/plain; action=pgp-*.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Mar 2002 00:39:26 +0000 (00:39 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Mar 2002 00:39:26 +0000 (00:39 +0000)
pgp.c
sendlib.c

diff --git a/pgp.c b/pgp.c
index 3d6f52c3a7570f7ff31d3c4cea918ee242007a60..041f422184e2edbb4cb3c0c272b6f3ca2813c7c3 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -1285,6 +1285,11 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
     return NULL;
   }
 
+  /* The following code is really correct:  If noconv is set,
+   * a's charset parameter contains the on-disk character set, and
+   * we have to convert from that to utf-8.  If noconv is not set,
+   * we have to convert from $charset to utf-8.
+   */
   if (a->noconv)
     mutt_get_body_charset (from_charset, sizeof (from_charset), a);
   else
index 1a10518725a833d07176e636a542d2a978b11e3e..80224681183454e8a2c203ee3224102ac3017507 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -446,6 +446,12 @@ int mutt_write_mime_header (BODY *a, FILE *f)
   return (ferror (f) ? -1 : 0);
 }
 
+#ifdef HAVE_PGP
+# define write_as_text_part(a) (mutt_is_text_part(a) || mutt_is_application_pgp(a))
+#else
+# define write_as_text_part(a) (mutt_is_text_part(a))
+#endif
+
 int mutt_write_mime_body (BODY *a, FILE *f)
 {
   char *p, boundary[SHORT_STRING];
@@ -506,11 +512,11 @@ int mutt_write_mime_body (BODY *a, FILE *f)
     fc = fgetconv_open (fpin, 0, 0, 0);
 
   if (a->encoding == ENCQUOTEDPRINTABLE)
-    encode_quoted (fc, f, mutt_is_text_part (a));
+    encode_quoted (fc, f, write_as_text_part (a));
   else if (a->encoding == ENCBASE64)
-    encode_base64 (fc, f, mutt_is_text_part (a));
+    encode_base64 (fc, f, write_as_text_part (a));
   else if (a->type == TYPETEXT && (!a->noconv))
-    encode_8bit (fc, f, mutt_is_text_part (a));
+    encode_8bit (fc, f, write_as_text_part (a));
   else
     mutt_copy_stream (fpin, f);
 
@@ -520,6 +526,8 @@ int mutt_write_mime_body (BODY *a, FILE *f)
   return (ferror (f) ? -1 : 0);
 }
 
+#undef write_as_text_part
+
 #define BOUNDARYLEN 16
 void mutt_generate_boundary (PARAMETER **parm)
 {