]> granicus.if.org Git - neomutt/commitdiff
factor out Context from mutt_make_message_attach()
authorRichard Russon <rich@flatcap.org>
Thu, 22 Nov 2018 13:22:15 +0000 (13:22 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 22 Nov 2018 13:45:24 +0000 (13:45 +0000)
compose.c
send.c
sendlib.c
sendlib.h

index aeb2f3da79e8e3760daa601180c22246cbfc6c13..40ab2e452e0635c77b610c26468a8e4315bf50db 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -1488,7 +1488,7 @@ int mutt_compose_menu(struct Email *msg, char *fcc, size_t fcclen, struct Email
 
           new = mutt_mem_calloc(1, sizeof(struct AttachPtr));
           new->content =
-              mutt_make_message_attach(Context, Context->mailbox->hdrs[i], true);
+              mutt_make_message_attach(Context->mailbox, Context->mailbox->hdrs[i], true);
           if (new->content)
             update_idx(menu, actx, new);
           else
diff --git a/send.c b/send.c
index 0057fe75e49f4bcf1822f119a5922ff1c82c12c5..f7c5ff5fd484bacde2f657490a89b4a3daad47dc 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1081,7 +1081,7 @@ static int generate_body(FILE *tempfp, struct Email *msg, int flags,
 
       if (cur)
       {
-        tmp = mutt_make_message_attach(ctx, cur, false);
+        tmp = mutt_make_message_attach(ctx->mailbox, cur, false);
         if (last)
           last->next = tmp;
         else
@@ -1094,7 +1094,7 @@ static int generate_body(FILE *tempfp, struct Email *msg, int flags,
           if (!message_is_tagged(ctx, i))
             continue;
 
-          tmp = mutt_make_message_attach(ctx, ctx->mailbox->hdrs[i], false);
+          tmp = mutt_make_message_attach(ctx->mailbox, ctx->mailbox->hdrs[i], false);
           if (last)
           {
             last->next = tmp;
index ea1658f0d1e5e77a855bbf85d191e3aedc6c5fb5..5522fd47af426fa4f419a7e4518741255458c12b 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1445,13 +1445,13 @@ void mutt_update_encoding(struct Body *a)
 
 /**
  * mutt_make_message_attach - Create a message attachment
- * @param ctx        Mailbox
- * @param e        Email
+ * @param m          Mailbox
+ * @param e          Email
  * @param attach_msg true if attaching a message
  * @retval ptr  Newly allocated Body
  * @retval NULL Error
  */
-struct Body *mutt_make_message_attach(struct Context *ctx, struct Email *e, bool attach_msg)
+struct Body *mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg)
 {
   char buf[LONG_STRING];
   struct Body *body = NULL;
@@ -1482,7 +1482,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Email *e, bool
   body->disposition = DISP_INLINE;
   body->noconv = true;
 
-  mutt_parse_mime_message(ctx->mailbox, e);
+  mutt_parse_mime_message(m, e);
 
   chflags = CH_XMIT;
   cmflags = 0;
@@ -1521,7 +1521,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Email *e, bool
     }
   }
 
-  mutt_copy_message_ctx(fp, ctx->mailbox, e, cmflags, chflags);
+  mutt_copy_message_ctx(fp, m, e, cmflags, chflags);
 
   fflush(fp);
   rewind(fp);
index ebacfbb5d2fcf2eedab226c784e7bca4fe0f8abf..119c997d2573a586a49a49d212a9b0ab88e4d324 100644 (file)
--- a/sendlib.h
+++ b/sendlib.h
 
 struct Address;
 struct Body;
-struct Context;
-struct Envelope;
 struct Email;
+struct Envelope;
 struct ListHead;
+struct Mailbox;
 struct ParameterList;
 
 /* These Config Variables are only used in sendlib.c */
@@ -61,7 +61,7 @@ struct Content *mutt_get_content_info(const char *fname, struct Body *b);
 int             mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc, struct Address *bcc, const char *msg, int eightbit);
 int             mutt_lookup_mime_type(struct Body *att, const char *path);
 struct Body *   mutt_make_file_attach(const char *path);
-struct Body *   mutt_make_message_attach(struct Context *ctx, struct Email *e, bool attach_msg);
+struct Body *   mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg);
 struct Body *   mutt_make_multipart(struct Body *b);
 void            mutt_message_to_7bit(struct Body *a, FILE *fp);
 void            mutt_prepare_envelope(struct Envelope *env, bool final);