From: Richard Russon Date: Thu, 22 Nov 2018 13:22:15 +0000 (+0000) Subject: factor out Context from mutt_make_message_attach() X-Git-Tag: 2019-10-25~500^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0eaa8683727948da77bf63535b82a7ee918926a5;p=neomutt factor out Context from mutt_make_message_attach() --- diff --git a/compose.c b/compose.c index aeb2f3da7..40ab2e452 100644 --- 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 0057fe75e..f7c5ff5fd 100644 --- 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; diff --git a/sendlib.c b/sendlib.c index ea1658f0d..5522fd47a 100644 --- 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); diff --git a/sendlib.h b/sendlib.h index ebacfbb5d..119c997d2 100644 --- a/sendlib.h +++ b/sendlib.h @@ -28,10 +28,10 @@ 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);