Changeset 216:41df0b80bfcd for attach.c

Show
Ignore:
Timestamp:
1998-07-24 01:12:45 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
mutt-0-94
Message:

Fiddling around with message/rfc822 attachments once again.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • attach.c

    r214 r216  
    541541 
    542542      char buf[HUGE_STRING]; 
     543      HEADER *hn; 
    543544      CONTEXT ctx; 
    544       HEADER *hn; 
     545      MESSAGE *msg; 
     546      int chflags = 0; 
    545547      int r = -1; 
    546548       
     
    554556      if (mx_open_mailbox(path, M_APPEND | M_QUIET, &ctx) == NULL) 
    555557        return -1; 
    556       if(mutt_append_message(&ctx, Context, hn, 0, 0) == 0) 
    557       { 
     558      if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0) ? 0 : M_ADD_FROM)) == NULL) 
     559      { 
     560        mx_close_mailbox(&ctx); 
     561        return -1; 
     562      } 
     563      if (ctx.magic == M_MBOX || ctx.magic == M_MMDF) 
     564        chflags = CH_FROM; 
     565      chflags |= (ctx.magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE); 
     566      if ((r = _mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags)) == 0) 
    558567        mutt_message("Attachment saved."); 
    559         r = 0; 
    560       } 
    561568         
     569      mx_close_message (&msg); 
    562570      mx_close_mailbox(&ctx); 
    563571      return r;