WHERE char *SendCharset;
WHERE char *Sendmail;
WHERE char *Shell;
+WHERE char *ShowMultipartAlternative;
#ifdef USE_SIDEBAR
WHERE char *SidebarDelimChars;
WHERE char *SidebarDividerChar;
int type = 0;
int mustfree = 0;
int rc = 0;
+ char length[5];
+ int count = 0;
if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE ||
a->encoding == ENCUUENCODED)
fseeko (s->fpin, choice->hdr_offset, 0);
mutt_copy_bytes(s->fpin, s->fpout, choice->offset-choice->hdr_offset);
}
+
+ if (mutt_strcmp ("info", ShowMultipartAlternative) == 0)
+ {
+ mutt_pretty_size (length, sizeof (length), choice->length);
+ state_mark_attach (s);
+ state_printf (s, _("[-- Type: %s/%s, Encoding: %s, Size: %s --]\n"),
+ TYPE (choice), choice->subtype, ENCODING (choice->encoding), length);
+ }
mutt_body_handler (choice, s);
+
+ if (mutt_strcmp ("info", ShowMultipartAlternative) == 0)
+ {
+ if (a && a->parts)
+ b = a->parts;
+ else
+ b = a;
+ while (b)
+ {
+ if (choice != b)
+ {
+ count += 1;
+ mutt_pretty_size (length, sizeof (length), b->length);
+ if (count == 1)
+ state_putc ('\n', s);
+
+ state_mark_attach (s);
+ state_printf (s, _("[-- Alternative Type #%d %s/%s, Encoding: %s, Size: %s --]\n"),
+ count, TYPE (b), b->subtype, ENCODING (b->encoding), length);
+ }
+ b = b->next;
+ }
+ }
}
else if (s->flags & MUTT_DISPLAY)
{
{
char *p;
- if (ascii_strcasecmp ("alternative", b->subtype) == 0)
+ if ((mutt_strcmp ("inline", ShowMultipartAlternative) != 0) && (ascii_strcasecmp ("alternative", b->subtype) == 0))
handler = alternative_handler;
else if (WithCrypto && ascii_strcasecmp ("signed", b->subtype) == 0)
{
return rc;
}
+static bool valid_show_multipart_alternative(const char *val)
+{
+ return ((mutt_strcmp(val, "inline") == 0) ||
+ (mutt_strcmp(val, "info") == 0) ||
+ (val == NULL) || (*val == 0));
+}
+
static int parse_setenv(BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err)
{
int query, unset, len;
*((char **) MuttVars[idx].data) = safe_strdup (tmp->data);
if (mutt_strcmp (MuttVars[idx].option, "charset") == 0)
mutt_set_charset (Charset);
+
+ if ((mutt_strcmp (MuttVars[idx].option, "show_multipart_alternative") == 0) &&
+ !valid_show_multipart_alternative(tmp->data))
+ {
+ snprintf (err->data, err->dsize, _("Invalid value for option %s: \"%s\""),
+ MuttVars[idx].option, tmp->data);
+ return -1;
+ }
}
else if (DTYPE (MuttVars[idx].type) == DT_MBCHARTBL)
{
** function; \fC<group-reply>\fP will reply to both the sender and the
** list.
*/
+ { "show_multipart_alternative", DT_STR, R_NONE, UL &ShowMultipartAlternative, 0 },
+ /*
+ ** .pp
+ ** When \fIset\fP to \fCinfo\fP, the multipart/alternative information is shown.
+ ** When \fIset\fP to \fCinline\fP, all of the alternatives are displayed.
+ ** When not set, the default behavior is to show only the chosen alternative.
+ ** .pp
+ */
#ifdef USE_IMAP
{ "imap_authenticators", DT_STR, R_NONE, UL &ImapAuthenticators, UL 0 },
/*