diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2001-02-13 15:01:57 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2001-02-13 15:01:57 +0000 |
commit | 98c469edcf550b35640b6a97940343f52db976bb (patch) | |
tree | 9ebde66e6564185acf2ce401d6ac9781c1c30717 /commands.c | |
parent | df41a1bb1b7e0a519dfc5ee8c05778cc45aebf94 (diff) |
Add a function check-traditional-pgp which can be used to handle
old-style PGP messages and/or parts more easily.
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -847,3 +847,43 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) #endif /* HAVE_PGP */ } + + +#ifdef HAVE_PGP + +static int _mutt_check_traditional_pgp (HEADER *h, int *redraw) +{ + MESSAGE *msg; + int rv = 0; + + mutt_parse_mime_message (Context, h); + if ((msg = mx_open_message (Context, h->msgno)) == NULL) + return 0; + if (pgp_check_traditional (msg->fp, h->content, 0)) + { + h->pgp = pgp_query (h->content); + *redraw |= REDRAW_FULL; + rv = 1; + } + + mx_close_message (&msg); + return rv; +} + +int mutt_check_traditional_pgp (HEADER *h, int *redraw) +{ + int i; + int rv = 0; + if (h) + rv = _mutt_check_traditional_pgp (h, redraw); + else + { + for (i = 0; i < Context->vcount; i++) + if (Context->hdrs[Context->v2r[i]]->tagged) + rv = _mutt_check_traditional_pgp (Context->hdrs[Context->v2r[i]], redraw) + || rv; + } + return rv; +} + +#endif |