Changeset 1640:89a63d6c0d6f
- Timestamp:
- 2000-03-16 02:01:43 (9 years ago)
- Author:
- Thomas Roessler <roessler@…>
- Branch:
- HEAD
- Message:
-
Add the $print_decode option.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1601
|
r1640
|
|
| 233 | 233 | } |
| 234 | 234 | |
| | 235 | static void pipe_print_set_flags (int decode, int *cmflags, int *chflags) |
| | 236 | { |
| | 237 | if (decode) |
| | 238 | { |
| | 239 | *cmflags |= M_CM_DECODE | M_CM_CHARCONV; |
| | 240 | *chflags |= CH_DECODE | CH_REORDER; |
| | 241 | |
| | 242 | if (option (OPTWEED)) |
| | 243 | { |
| | 244 | *chflags |= CH_WEED; |
| | 245 | *cmflags |= M_CM_WEED; |
| | 246 | } |
| | 247 | } |
| | 248 | } |
| | 249 | |
| 235 | 250 | void mutt_pipe_message_to_state (HEADER *h, STATE *s) |
| 236 | 251 | { |
| … |
… |
|
| 238 | 253 | int chflags = CH_FROM; |
| 239 | 254 | |
| 240 | | if (option (OPTPIPEDECODE)) |
| 241 | | { |
| 242 | | cmflags |= M_CM_DECODE | M_CM_CHARCONV; |
| 243 | | chflags |= CH_DECODE | CH_REORDER; |
| 244 | | |
| 245 | | if (option (OPTWEED)) |
| 246 | | { |
| 247 | | chflags |= CH_WEED; |
| 248 | | cmflags |= M_CM_WEED; |
| 249 | | } |
| 250 | | } |
| | 255 | pipe_print_set_flags (option (OPTPIPEDECODE), &cmflags, &chflags); |
| 251 | 256 | |
| 252 | 257 | if (option (OPTPIPEDECODE)) |
| … |
… |
|
| 687 | 692 | } |
| 688 | 693 | |
| | 694 | /* XXX - merge this with mutt_pipe_message_to_state? */ |
| | 695 | |
| 689 | 696 | static void print_msg (FILE *fp, CONTEXT *ctx, HEADER *h) |
| 690 | 697 | { |
| 691 | | int cmflags = M_CM_DECODE | M_CM_CHARCONV; |
| 692 | | int chflags = CH_DECODE | CH_REORDER; |
| 693 | | |
| 694 | | if (option (OPTWEED)) |
| 695 | | { |
| 696 | | cmflags |= M_CM_WEED; |
| 697 | | chflags |= CH_WEED; |
| 698 | | } |
| 699 | | |
| 700 | | #ifdef HAVE_PGP |
| 701 | | if (h->pgp & PGPENCRYPT) |
| | 698 | int cmflags = 0; |
| | 699 | int chflags = CH_FROM; |
| | 700 | |
| | 701 | pipe_print_set_flags (option (OPTPRINTDECODE), &cmflags, &chflags); |
| | 702 | |
| | 703 | #ifdef HAVE_PGP |
| | 704 | if (option (OPTPRINTDECODE) && (h->pgp & PGPENCRYPT)) |
| 702 | 705 | { |
| 703 | 706 | if (!pgp_valid_passphrase ()) |
| … |
… |
|
| 707 | 710 | #endif |
| 708 | 711 | |
| 709 | | mutt_parse_mime_message (ctx, h); |
| | 712 | if (option (OPTPRINTDECODE)) |
| | 713 | mutt_parse_mime_message (ctx, h); |
| | 714 | |
| 710 | 715 | mutt_copy_message (fp, ctx, h, cmflags, chflags); |
| 711 | 716 | } |
-
|
r1635
|
r1640
|
|
| 1463 | 1463 | /* |
| 1464 | 1464 | */ |
| | 1465 | { "print_decode", DT_BOOL, R_NONE, OPTPRINTDECODE, 1 }, |
| | 1466 | /* |
| | 1467 | ** .pp |
| | 1468 | ** Used in connection with the print-message command. If this |
| | 1469 | ** option is set, the message is decoded before it is passed to the |
| | 1470 | ** external command specified by $$print_command. If this option |
| | 1471 | ** is unset, no processing will be applied to the message when |
| | 1472 | ** printing it. The latter setting may be useful if you are using |
| | 1473 | ** some advanced printer filter which is able to properly format |
| | 1474 | ** e-mail messages for printing. |
| | 1475 | */ |
| 1465 | 1476 | { "prompt_after", DT_BOOL, R_NONE, OPTPROMPTAFTER, 1 }, |
| 1466 | 1477 | /* |
-
|
r1601
|
r1640
|
|
| 322 | 322 | OPTPOPDELETE, |
| 323 | 323 | OPTPOPLAST, |
| | 324 | OPTPRINTDECODE, |
| 324 | 325 | OPTPROMPTAFTER, |
| 325 | 326 | OPTREADONLY, |