Show
Ignore:
Timestamp:
2001-02-13 07:01:57 (8 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Add a function check-traditional-pgp which can be used to handle
old-style PGP messages and/or parts more easily.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • commands.c

    r2270 r2285  
    848848 
    849849} 
     850 
     851 
     852#ifdef HAVE_PGP 
     853 
     854static int _mutt_check_traditional_pgp (HEADER *h, int *redraw) 
     855{ 
     856  MESSAGE *msg; 
     857  int rv = 0; 
     858   
     859  mutt_parse_mime_message (Context, h); 
     860  if ((msg = mx_open_message (Context, h->msgno)) == NULL) 
     861    return 0; 
     862  if (pgp_check_traditional (msg->fp, h->content, 0)) 
     863  { 
     864    h->pgp = pgp_query (h->content); 
     865    *redraw |= REDRAW_FULL; 
     866    rv = 1; 
     867  } 
     868   
     869  mx_close_message (&msg); 
     870  return rv; 
     871} 
     872 
     873int mutt_check_traditional_pgp (HEADER *h, int *redraw) 
     874{ 
     875  int i; 
     876  int rv = 0; 
     877  if (h) 
     878    rv = _mutt_check_traditional_pgp (h, redraw); 
     879  else 
     880  { 
     881    for (i = 0; i < Context->vcount; i++) 
     882      if (Context->hdrs[Context->v2r[i]]->tagged) 
     883        rv = _mutt_check_traditional_pgp (Context->hdrs[Context->v2r[i]], redraw) 
     884          || rv; 
     885  } 
     886  return rv; 
     887} 
     888 
     889#endif