]> granicus.if.org Git - neomutt/commitdiff
merge: multiple-fcc
authorRichard Russon <rich@flatcap.org>
Thu, 18 Aug 2016 21:12:48 +0000 (22:12 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 18 Aug 2016 21:12:48 +0000 (22:12 +0100)
 * add ident to PATCHES
 * feature: multiple-fcc

1  2 
PATCHES
protos.h
send.c
sendlib.c

diff --cc PATCHES
index 6c27a167b9a3243737a0f671790027541f5611f2,4ee2d1eb26ed534180eba874aeeb29f99ded2a26..5bfa313b7649187f71c18288d1df80fb70050aad
+++ b/PATCHES
@@@ -1,20 -1,1 +1,21 @@@
 +patch-compress-neomutt
 +patch-cond-date-neomutt
 +patch-fmemopen-neomutt
 +patch-ifdef-neomutt
 +patch-index-color-neomutt
 +patch-initials-neomutt
 +patch-keywords-neomutt
 +patch-limit-current-thread-neomutt
 +patch-lmdb-neomutt
+ patch-multiple-fcc-neomutt
 +patch-nested-if-neomutt
 +patch-new-mail-neomutt
 +patch-nntp-neomutt
 +patch-notmuch-neomutt
 +patch-progress-neomutt
 +patch-quasi-delete-neomutt
 +patch-sidebar-neomutt
 +patch-skip-quoted-neomutt
 +patch-smime-encrypt-self-neomutt
 +patch-status-color-neomutt
 +patch-tls-sni-neomutt
diff --cc protos.h
index 4e9ac2a1b68a91f78295bd73292032a07b4b855c,4b80e63b5a007c2a52676e8847a920fa15cd613d..694d2ea7d336cf13e308598e019324753f7897f2
+++ b/protos.h
@@@ -385,7 -367,8 +385,8 @@@ int mutt_user_is_recipient (HEADER *)
  void mutt_update_num_postponed (void);
  int mutt_wait_filter (pid_t);
  int mutt_which_case (const char *);
 -int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *);
 -int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *);
 +int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *, char **);
++int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *, char **);
  int mutt_write_mime_body (BODY *, FILE *);
  int mutt_write_mime_header (BODY *, FILE *);
  int mutt_write_one_header (FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags);
diff --cc send.c
index 59953dca8e4e47bc1fa27b6803107285b1fc565a,dddd6c9c057c69727b2807f06b757040c6e4942f..007218fbb89d7f2963b719048a650611e2e5315c
--- 1/send.c
--- 2/send.c
+++ b/send.c
@@@ -1975,7 -1831,7 +1975,7 @@@ full_fcc
         * message was first postponed.
         */
        msg->received = time (NULL);
-       if (mutt_write_fcc (fcc, msg, NULL, 0, NULL, &finalpath) == -1)
 -      if (mutt_write_multiple_fcc (fcc, msg, NULL, 0, NULL) == -1)
++      if (mutt_write_multiple_fcc (fcc, msg, NULL, 0, NULL, &finalpath) == -1)
        {
        /*
         * Error writing FCC, we should abort sending.
diff --cc sendlib.c
index 45a9e815538f542f1eed7b1081542f121c3e1b80,7a88a37ad4aa918ae035b6d433143d539b61df58..98407c4a75fd4c7f336541bc5ae0c33c81a01b80
+++ b/sendlib.c
@@@ -2759,8 -2690,43 +2759,44 @@@ static void set_noconv_flags (BODY *b, 
    }
  }
  
 -        int post, char *fcc)
+ /* Handle a Fcc with multiple, comma separated entries. */
+ int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid,
 -  status = mutt_write_fcc (tok, hdr, msgid, post, fcc);
++        int post, char *fcc, char **finalpath)
+ {
+   char fcc_tok[_POSIX_PATH_MAX];
+   char fcc_expanded[_POSIX_PATH_MAX];
+   char *tok = NULL;
+   int status;
+   strfcpy(fcc_tok, path, sizeof (fcc_tok));
+   tok = strtok(fcc_tok, ",");
+   dprint(1, (debugfile, "Fcc: initial mailbox = '%s'\n", tok));
+   /* mutt_expand_path already called above for the first token */
 -    status = mutt_write_fcc (fcc_expanded, hdr, msgid, post, fcc);
++  status = mutt_write_fcc (tok, hdr, msgid, post, fcc, finalpath);
+   if (status != 0)
+     return status;
+   while ((tok = strtok (NULL, ",")) != NULL)
+   {
+     if (!*tok)
+       continue;
+     /* Only call mutt_expand_path iff tok has some data */
+     dprint (1, (debugfile, "Fcc: additional mailbox token = '%s'\n", tok));
+     strfcpy (fcc_expanded, tok, sizeof (fcc_expanded));
+     mutt_expand_path (fcc_expanded, sizeof (fcc_expanded));
+     dprint (1, (debugfile, "     Additional mailbox expanded = '%s'\n", fcc_expanded));
 -int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, char *fcc)
++    status = mutt_write_fcc (fcc_expanded, hdr, msgid, post, fcc, finalpath);
+     if (status != 0)
+       return status;
+   }
+   return 0;
+ }
 +int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid,
 +                  int post, char *fcc, char **finalpath)
  {
    CONTEXT f;
    MESSAGE *msg;