#include <lib-mime/mime.h>
#include <lib-mime/rfc3676.h>
-#include <lib-ui/curses.h>
+#include <lib-ui/lib-ui.h>
#include <lib-sys/unix.h>
#include "keymap.h"
#include "copy.h"
#include "charset.h"
-#include <lib-crypt/crypt.h>
+#include "crypt.h"
#include "state.h"
#include "attach.h"
-#include "lib.h"
-
typedef int handler_f (BODY *, STATE *);
typedef handler_f *handler_t;
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);
}
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;
}
const char *charset = parameter_getval(b->parameter, "charset");
if (!charset)
- charset = charset_getfirst(MCharset.assumed_charset);
- if (charset && MCharset.charset)
- cd = mutt_iconv_open (MCharset.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 (MCharset.charset, b->file_charset, M_ICONV_HOOK_FROM);
+ cd = mutt_iconv_open (mod_cset.charset, b->file_charset, M_ICONV_HOOK_FROM);
}
}
if (!plaintext) {
/* decode to a tempfile, saving the original destination */
fp = s->fpout;
- s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), 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;
s->fpin = fp;
}
}
- s->flags |= M_FIRSTDONE;
}
else if (s->flags & M_DISPLAY) {
state_mark_attach (s);
}
bail:
- s->flags = oflags | (s->flags & M_FIRSTDONE);
-
+ s->flags = oflags;
return (rc);
}