if ((hdr->pgp & PGPENCRYPT) && hdr->content->type == TYPEMULTIPART)
if ((hdr->pgp & PGPENCRYPT) && mutt_is_multipart_encrypted(hdr->content))
void mutt_view_attachments (HEADER *hdr){#ifdef _PGPPATH  int pgp = 0;#endif  char helpstr[SHORT_STRING];  MUTTMENU *menu;  BODY *cur;  MESSAGE *msg;  FILE *fp;  ATTACHPTR **idx = NULL;  short idxlen = 0;  short idxmax = 0;  int flags = 0;  int op;    /* make sure we have parsed this message */  mutt_parse_mime_message (Context, hdr);  if ((msg = mx_open_message (Context, hdr->msgno)) == NULL)    return;#ifdef _PGPPATH  if((hdr->pgp & PGPENCRYPT) && !pgp_valid_passphrase())  {    mx_close_message(&msg);    return;  }    if ((hdr->pgp & PGPENCRYPT) && hdr->content->type == TYPEMULTIPART)  {    if (pgp_decrypt_mime (msg->fp, &fp, hdr->content->parts->next, &cur))    {      mx_close_message (&msg);      return;    }    pgp = 1;  }  else#endif /* _PGPPATH */  {    fp = msg->fp;    cur = hdr->content;  }  idx = mutt_gen_attach_list (cur, idx, &idxlen, &idxmax, 0, 0);  menu = mutt_new_menu ();  menu->max = idxlen;  menu->make_entry = attach_entry;  menu->tag = mutt_tag_attach;  menu->menu = MENU_ATTACH;  menu->title = "Attachments";  menu->data = idx;  menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_ATTACH, AttachHelp);  FOREVER  {    switch (op = mutt_menuLoop (menu))    {      case OP_DISPLAY_HEADERS:      case OP_VIEW_ATTACH:	mutt_attach_display_loop (menu, op, fp, idx);	menu->redraw = REDRAW_FULL;	break;      case OP_ATTACH_VIEW_MAILCAP:	mutt_view_attachment (fp, idx[menu->current]->content, M_MAILCAP);	menu->redraw = REDRAW_FULL;	break;      case OP_ATTACH_VIEW_TEXT:	mutt_view_attachment (fp, idx[menu->current]->content, M_AS_TEXT);	menu->redraw = REDRAW_FULL;	break;#ifdef _PGPPATH      case OP_EXTRACT_KEYS:        pgp_extract_keys_from_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content);        menu->redraw = REDRAW_FULL;        break;#endif            case OP_PRINT:	mutt_print_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content);	break;      case OP_PIPE:	mutt_pipe_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content, 0);	break;      case OP_SAVE:	mutt_save_attachment_list (fp, menu->tagprefix, menu->tagprefix ?  cur : idx[menu->current]->content, hdr);	if (option (OPTRESOLVE) && menu->current < menu->max - 1)	  menu->current++;              menu->redraw = REDRAW_MOTION_RESYNCH | REDRAW_FULL;	break;      case OP_DELETE:       if (menu->max == 1)       {         mutt_message ("Only deletion of multipart attachments is supported.");       }       else       {#ifdef _PGPPATH         if (hdr->pgp)         {           mutt_message (             "Deletion of attachments from PGP messages is unsupported.");         }         else#endif         {	   if (!menu->tagprefix)	   {	     idx[menu->current]->content->deleted = 1;	     if (option (OPTRESOLVE) && menu->current < menu->max - 1)	     {	       menu->current++;	       menu->redraw = REDRAW_MOTION_RESYNCH;	     }	     else	       menu->redraw = REDRAW_CURRENT;	   }	   else	   {	     int x;	     for (x = 0; x < menu->max; x++)	     {	       if (idx[x]->content->tagged)	       {		 idx[x]->content->deleted = 1;		 menu->redraw = REDRAW_INDEX;	       }	     }	   }         }       }       break;      case OP_UNDELETE:       if (!menu->tagprefix)       {	 idx[menu->current]->content->deleted = 0;	 if (option (OPTRESOLVE) && menu->current < menu->max - 1)	 {	   menu->current++;	   menu->redraw = REDRAW_MOTION_RESYNCH;	 }	 else	   menu->redraw = REDRAW_CURRENT;       }       else       {	 int x;	 for (x = 0; x < menu->max; x++)	 {	   if (idx[x]->content->tagged)	   {	     idx[x]->content->deleted = 0;	     menu->redraw = REDRAW_INDEX;	   }	 }       }       break;      case OP_BOUNCE_MESSAGE:	query_bounce_attachment (menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content, hdr);	break;      case OP_REPLY:      case OP_GROUP_REPLY:      case OP_LIST_REPLY:      case OP_FORWARD_MESSAGE:#ifdef _PGPPATH	if ((hdr->pgp & PGPENCRYPT) && hdr->content->type == TYPEMULTIPART)	{	  mutt_error (	    "This operation is not currently supported for PGP messages.");	  break;	}#endif	if (op == OP_FORWARD_MESSAGE)	  flags = SENDFORWARD;	else	  flags = SENDREPLY | 		  (op == OP_GROUP_REPLY ? SENDGROUPREPLY : 0) |		  (op == OP_LIST_REPLY ? SENDLISTREPLY : 0);	reply_attachment_list (flags,			       menu->tagprefix,			       hdr,			       menu->tagprefix ? cur : idx[menu->current]->content);	menu->redraw = REDRAW_FULL;	break;      case OP_EXIT:	mx_close_message (&msg);	hdr->attach_del = 0;	while (idxlen-- > 0)	{	  if (idx[idxlen]->content->deleted)	    hdr->attach_del = 1;	  safe_free ((void **) &idx[idxlen]->tree);	  safe_free ((void **) &idx[idxlen]);	}	if (hdr->attach_del)	  hdr->changed = 1;	safe_free ((void **) &idx);	idxmax = 0;#ifdef _PGPPATH	if (pgp)	{	  fclose (fp);	  mutt_free_body (&cur);	}#endif /* _PGPPATH */	mutt_menuDestroy  (&menu);	return;    }  }  /* not reached */}