X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=handler.c;h=d3a3773c099f917b7eab88bc0f448e35418d946d;hp=5df2b213548abbc93bcead3376bba1be2df2eb9b;hb=8b89861e79d1b2e8ddcc54ea4d89957d6d10ebe6;hpb=07ccefd6c97ddd433d8432f7b4596a5572e09b48 diff --git a/handler.c b/handler.c index 5df2b21..d3a3773 100644 --- a/handler.c +++ b/handler.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include @@ -22,11 +22,9 @@ #include "keymap.h" #include "copy.h" #include "charset.h" -#include +#include "crypt.h" #include "state.h" #include "attach.h" -#include "lib.h" - typedef int handler_f (BODY *, STATE *); typedef handler_f *handler_t; @@ -641,9 +639,8 @@ static int text_enriched_handler (BODY * a, STATE * s) p_clear(&stte, 1); stte.s = s; - stte.WrapMargin = - ((s->flags & M_DISPLAY) ? (COLS - 4) : ((COLS - 4) < - 72) ? (COLS - 4) : 72); + stte.WrapMargin = ((s->flags & M_DISPLAY) ? (getmaxx(main_w) - 4) : + ((getmaxx(main_w) - 4) < 72) ? (getmaxx(main_w) - 4) : 72); stte.line_max = stte.WrapMargin * 4; stte.line = p_new(char, stte.line_max + 1); stte.param = p_new(char, STRING); @@ -1029,8 +1026,7 @@ static int multipart_handler (BODY * a, STATE * s) } rc = mutt_body_handler (p, s); state_putc ('\n', s); - if (rc || ((s->flags & M_REPLYING) - && (option (OPTINCLUDEONLYFIRST)) && (s->flags & M_FIRSTDONE))) + if (rc) break; } @@ -1252,12 +1248,12 @@ void mutt_decode_attachment (BODY * b, STATE * s) const char *charset = parameter_getval(b->parameter, "charset"); if (!charset) - charset = charset_getfirst(AssumedCharset); - if (charset && Charset) - cd = mutt_iconv_open (Charset, charset, M_ICONV_HOOK_FROM); + charset = charset_getfirst(mod_cset.assumed_charset); + if (charset && mod_cset.charset) + cd = mutt_iconv_open (mod_cset.charset, charset, M_ICONV_HOOK_FROM); } else { if (b->file_charset) - cd = mutt_iconv_open (Charset, b->file_charset, M_ICONV_HOOK_FROM); + cd = mutt_iconv_open (mod_cset.charset, b->file_charset, M_ICONV_HOOK_FROM); } } @@ -1357,7 +1353,7 @@ int mutt_body_handler (BODY * b, STATE * s) if (!p) mutt_error(_("Error: multipart/encrypted has no protocol parameter!")); - else if (tok == MIME_APPLICATION_PGP_ENCRYPTED) + else if (mime_which_token(p, -1) == MIME_APPLICATION_PGP_ENCRYPTED) handler = crypt_pgp_encrypted_handler; } @@ -1385,7 +1381,7 @@ int mutt_body_handler (BODY * b, STATE * s) if (!plaintext) { /* decode to a tempfile, saving the original destination */ fp = s->fpout; - s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL); if (!s->fpout) { mutt_error _("Unable to open temporary file!"); goto bail; @@ -1440,7 +1436,6 @@ int mutt_body_handler (BODY * b, STATE * s) s->fpin = fp; } } - s->flags |= M_FIRSTDONE; } else if (s->flags & M_DISPLAY) { state_mark_attach (s); @@ -1457,7 +1452,6 @@ int mutt_body_handler (BODY * b, STATE * s) } bail: - s->flags = oflags | (s->flags & M_FIRSTDONE); - + s->flags = oflags; return (rc); }