mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Create multipart/mixed helpers.

Since we will be dealing with multipart/alternative, we need the
helpers to be a bit more specific.

We need to distinguish a top-level multipart/alternative from a
multipart/mixed created because of attachments.

+37 -15
+2 -2
compose.c
··· 1607 1607 mutt_buffer_expand_path (fname); 1608 1608 1609 1609 if (msg->content->next) 1610 - msg->content = mutt_make_multipart (msg->content); 1610 + msg->content = mutt_make_multipart_mixed (msg->content); 1611 1611 1612 1612 if (mutt_write_fcc (mutt_b2s (fname), msg, NULL, 0, NULL) == 0) 1613 1613 mutt_message _("Message written."); 1614 1614 1615 - msg->content = mutt_remove_multipart (msg->content); 1615 + msg->content = mutt_remove_multipart_mixed (msg->content); 1616 1616 } 1617 1617 break; 1618 1618
+1 -1
main.c
··· 1237 1237 if (rv < 0) 1238 1238 { 1239 1239 if (msg->content->next) 1240 - msg->content = mutt_make_multipart (msg->content); 1240 + msg->content = mutt_make_multipart_mixed (msg->content); 1241 1241 mutt_encode_descriptions (msg->content, 1); 1242 1242 mutt_prepare_envelope (msg->env, 0); 1243 1243 mutt_env_to_intl (msg->env, NULL, NULL);
+3 -1
postpone.c
··· 671 671 */ 672 672 673 673 if (newhdr->content->type == TYPEMULTIPART) 674 - newhdr->content = mutt_remove_multipart (newhdr->content); 674 + newhdr->content = mutt_remove_multipart_mixed (newhdr->content); 675 + 676 + /* TODO: deal with multipart/alternative here */ 675 677 676 678 s.fpin = bfp; 677 679
+2 -1
protos.h
··· 94 94 BODY *mutt_make_file_attach (const char *); 95 95 BODY *mutt_make_message_attach (CONTEXT *, HEADER *, int); 96 96 BODY *mutt_remove_multipart (BODY *); 97 - BODY *mutt_make_multipart (BODY *); 97 + BODY *mutt_remove_multipart_mixed (BODY *); 98 + BODY *mutt_make_multipart_mixed (BODY *); 98 99 BODY *mutt_new_body (void); 99 100 BODY *mutt_parse_multipart (FILE *, const char *, LOFF_T, int); 100 101 BODY *mutt_parse_messageRFC822 (FILE *, BODY *);
+12 -8
send.c
··· 1479 1479 } 1480 1480 1481 1481 if (msg->content->next) 1482 - msg->content = mutt_make_multipart (msg->content); 1482 + msg->content = mutt_make_multipart_mixed (msg->content); 1483 1483 1484 1484 mutt_encode_descriptions (msg->content, 1); 1485 1485 ··· 1498 1498 { 1499 1499 if (mutt_autocrypt_set_sign_as_default_key (msg)) 1500 1500 { 1501 - msg->content = mutt_remove_multipart (msg->content); 1501 + msg->content = mutt_remove_multipart_mixed (msg->content); 1502 1502 decode_descriptions (msg->content); 1503 1503 return -1; 1504 1504 } ··· 1513 1513 if (mutt_protect (msg, pgpkeylist, 1) == -1) 1514 1514 { 1515 1515 FREE (&pgpkeylist); 1516 - msg->content = mutt_remove_multipart (msg->content); 1516 + msg->content = mutt_remove_multipart_mixed (msg->content); 1517 1517 decode_descriptions (msg->content); 1518 1518 return -1; 1519 1519 } ··· 1542 1542 msg->content = clear_content; 1543 1543 } 1544 1544 mutt_free_envelope (&msg->content->mime_headers); /* protected headers */ 1545 - msg->content = mutt_remove_multipart (msg->content); 1545 + msg->content = mutt_remove_multipart_mixed (msg->content); 1546 1546 decode_descriptions (msg->content); 1547 1547 mutt_unprepare_envelope (msg->env); 1548 1548 return -1; ··· 2119 2119 } 2120 2120 } 2121 2121 2122 + /* multipart/alternative generation does here */ 2123 + 2122 2124 if (msg->content->next) 2123 - msg->content = mutt_make_multipart (msg->content); 2125 + msg->content = mutt_make_multipart_mixed (msg->content); 2124 2126 2125 2127 /* 2126 2128 * Ok, we need to do it this way instead of handling all fcc stuff in ··· 2150 2152 if ((crypt_get_keys (msg, &pgpkeylist, 0) == -1) || 2151 2153 mutt_protect (msg, pgpkeylist, 0) == -1) 2152 2154 { 2153 - msg->content = mutt_remove_multipart (msg->content); 2155 + msg->content = mutt_remove_multipart_mixed (msg->content); 2154 2156 2155 2157 FREE (&pgpkeylist); 2156 2158 ··· 2197 2199 mutt_free_body (&msg->content); /* destroy PGP data */ 2198 2200 msg->content = clear_content; /* restore clear text. */ 2199 2201 } 2200 - else if ((msg->security & SIGN) && msg->content->type == TYPEMULTIPART) 2202 + else if ((msg->security & SIGN) && 2203 + msg->content->type == TYPEMULTIPART && 2204 + !ascii_strcasecmp (msg->content->subtype, "signed")) 2201 2205 { 2202 2206 mutt_free_body (&msg->content->parts->next); /* destroy sig */ 2203 2207 msg->content = mutt_remove_multipart (msg->content); ··· 2205 2209 2206 2210 FREE (&pgpkeylist); 2207 2211 mutt_free_envelope (&msg->content->mime_headers); /* protected headers */ 2208 - msg->content = mutt_remove_multipart (msg->content); 2212 + msg->content = mutt_remove_multipart_mixed (msg->content); 2209 2213 decode_descriptions (msg->content); 2210 2214 mutt_unprepare_envelope (msg->env); 2211 2215 goto main_loop;
+17 -2
sendlib.c
··· 1507 1507 return 0; 1508 1508 } 1509 1509 1510 - BODY *mutt_make_multipart (BODY *b) 1510 + static BODY *mutt_make_multipart (BODY *b, const char *subtype) 1511 1511 { 1512 1512 BODY *new; 1513 1513 1514 1514 new = mutt_new_body (); 1515 1515 new->type = TYPEMULTIPART; 1516 - new->subtype = safe_strdup ("mixed"); 1516 + new->subtype = safe_strdup (subtype); 1517 1517 new->encoding = get_toplevel_encoding (b); 1518 1518 do 1519 1519 { ··· 1542 1542 t->parts = NULL; 1543 1543 mutt_free_body (&t); 1544 1544 } 1545 + return b; 1546 + } 1547 + 1548 + BODY *mutt_make_multipart_mixed (BODY *b) 1549 + { 1550 + return mutt_make_multipart (b, "mixed"); 1551 + } 1552 + 1553 + /* remove the multipart/mixed body if it exists */ 1554 + BODY *mutt_remove_multipart_mixed (BODY *b) 1555 + { 1556 + if ((b->type == TYPEMULTIPART) && 1557 + !ascii_strcasecmp (b->subtype, "mixed")) 1558 + return mutt_remove_multipart (b); 1559 + 1545 1560 return b; 1546 1561 } 1547 1562