/*
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1996-2000,2002,2007 Michael R. Elkins <me@mutt.org>
* Copyright (C) 2004 g10 Code GmbH
*
* This program is free software; you can redistribute it and/or modify
{ N_("Attach file"), OP_COMPOSE_ATTACH_FILE },
{ N_("Descrip"), OP_COMPOSE_EDIT_DESCRIPTION },
{ N_("Help"), OP_HELP },
- { NULL }
+ { NULL, 0 }
};
static void snd_entry (char *b, size_t blen, MUTTMENU *menu, int num)
{
int off = 0;
- if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
- {
- if (!msg->security)
- mvaddstr (HDR_CRYPT, 0, "Security: ");
- else if (msg->security & APPLICATION_SMIME)
- mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
- else if (msg->security & APPLICATION_PGP)
- mvaddstr (HDR_CRYPT, 0, " PGP: ");
- }
- else if ((WithCrypto & APPLICATION_SMIME))
- mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
- else if ((WithCrypto & APPLICATION_PGP))
- mvaddstr (HDR_CRYPT, 0, " PGP: ");
- else
+ mvaddstr (HDR_CRYPT, 0, "Security: ");
+
+ if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
+ {
+ addstr(_("Not supported"));
return;
+ }
if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
addstr (_("Sign, Encrypt"));
else if (msg->security & SIGN)
addstr (_("Sign"));
else
- addstr (_("Clear"));
+ addstr (_("None"));
- if ((WithCrypto & APPLICATION_PGP))
- if ((msg->security & APPLICATION_PGP)
- && (msg->security & (ENCRYPT | SIGN)))
+ if ((msg->security & (ENCRYPT | SIGN)))
+ {
+ if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
{
if ((msg->security & INLINE))
- addstr (_(" (inline)"));
+ addstr (_(" (inline PGP)"));
else
- addstr (_(" (PGP/MIME)"));
+ addstr (_(" (PGP/MIME)"));
}
- clrtoeol ();
+ else if ((WithCrypto & APPLICATION_SMIME) &&
+ (msg->security & APPLICATION_SMIME))
+ addstr (_(" (S/MIME)"));
+ }
+ clrtoeol ();
move (HDR_CRYPTINFO, 0);
clrtoeol ();
+
if ((WithCrypto & APPLICATION_PGP)
&& msg->security & APPLICATION_PGP && msg->security & SIGN)
printw ("%s%s", _(" sign as: "), PgpSignAs ? PgpSignAs : _("<default>"));
strfcpy(pretty, idx[i]->content->filename, sizeof(pretty));
if(stat(idx[i]->content->filename, &st) != 0)
{
- mutt_pretty_mailbox(pretty);
+ mutt_pretty_mailbox(pretty, sizeof (pretty));
mutt_error(_("%s [#%d] no longer exists!"),
pretty, i+1);
return -1;
if(idx[i]->content->stamp < st.st_mtime)
{
- mutt_pretty_mailbox(pretty);
+ mutt_pretty_mailbox(pretty, sizeof (pretty));
snprintf(msg, sizeof(msg), _("%s [#%d] modified. Update encoding?"),
pretty, i+1);
static void draw_envelope_addr (int line, ADDRESS *addr)
{
- char buf[STRING];
+ char buf[LONG_STRING];
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), addr, 1);
mutt_attach_init (msg->content);
idx = mutt_gen_attach_list (msg->content, -1, idx, &idxlen, &idxmax, 0, 1);
- menu = mutt_new_menu ();
- menu->menu = MENU_COMPOSE;
+ menu = mutt_new_menu (MENU_COMPOSE);
menu->offset = HDR_ATTACH;
menu->max = idxlen;
menu->make_entry = snd_entry;
strfcpy (buf, fcc, sizeof (buf));
if (mutt_get_field ("Fcc: ", buf, sizeof (buf), M_FILE | M_CLEAR) == 0)
{
- strfcpy (fcc, buf, _POSIX_PATH_MAX);
- mutt_pretty_mailbox (fcc);
+ strfcpy (fcc, buf, fcclen);
+ mutt_pretty_mailbox (fcc, fcclen);
move (HDR_FCC, HDR_XOFFSET);
mutt_paddstr (W, fcc);
fccSet = 1;
{
mutt_edit_file (Editor, msg->content->filename);
mutt_update_encoding (msg->content);
- menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
+ menu->redraw = REDRAW_FULL;
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
}
if (Context)
{
strfcpy (fname, NONULL (Context->path), sizeof (fname));
- mutt_pretty_mailbox (fname);
+ mutt_pretty_mailbox (fname, sizeof (fname));
}
if (mutt_enter_fname (prompt, fname, sizeof (fname), &menu->redraw, 1) == -1 || !fname[0])
case OP_COMPOSE_RENAME_FILE:
CHECK_COUNT;
strfcpy (fname, idx[menu->current]->content->filename, sizeof (fname));
- mutt_pretty_mailbox (fname);
+ mutt_pretty_mailbox (fname, sizeof (fname));
if (mutt_get_field (_("Rename to: "), fname, sizeof (fname), M_FILE)
== 0 && fname[0])
{
FREE (&idx[idxlen]);
continue;
}
- fclose (fp);
+ safe_fclose (&fp);
if ((idx[idxlen]->content = mutt_make_file_attach (fname)) == NULL)
{
if (Context)
{
strfcpy (fname, NONULL (Context->path), sizeof (fname));
- mutt_pretty_mailbox (fname);
+ mutt_pretty_mailbox (fname, sizeof (fname));
}
if (idxlen)
msg->content = idx[0]->content;
if (msg->content->next)
msg->content = mutt_make_multipart (msg->content);
- if (mutt_write_fcc (fname, msg, NULL, 1, NULL) < 0)
+ if (mutt_write_fcc (fname, msg, NULL, 0, NULL) < 0)
msg->content = mutt_remove_multipart (msg->content);
else
mutt_message _("Message written.");