return -1;
}
- if (mutt_prepare_template(NULL, PostContext, hdr, e, false) < 0)
+ if (mutt_prepare_template(NULL, PostContext->mailbox, hdr, e, false) < 0)
{
mx_fastclose_mailbox(PostContext);
FREE(&PostContext);
/**
* mutt_prepare_template - Prepare a message template
* @param fp If not NULL, file containing the template
- * @param ctx If fp is NULL, the context containing the header with the template
+ * @param m If fp is NULL, the Mailbox containing the header with the template
* @param newhdr The template is read into this Header
* @param e Email to recall/resend
* @param resend Set if resending (as opposed to recalling a postponed msg)
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Email *newhdr,
+int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr,
struct Email *e, bool resend)
{
struct Message *msg = NULL;
struct State s = { 0 };
int sec_type;
- if (!fp && !(msg = mx_msg_open(ctx->mailbox, e->msgno)))
+ if (!fp && !(msg = mx_msg_open(m, e->msgno)))
return -1;
if (!fp)
if (bfp != fp)
mutt_file_fclose(&bfp);
if (msg)
- mx_msg_close(ctx->mailbox, &msg);
+ mx_msg_close(m, &msg);
if (rc == -1)
{
int mutt_complete(char *buf, size_t buflen);
int mutt_edit_message(struct Context *ctx, struct Email *e);
int mutt_view_message(struct Context *ctx, struct Email *e);
-int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Email *newhdr, struct Email *e, bool resend);
+int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr, struct Email *e, bool resend);
int mutt_enter_string(char *buf, size_t buflen, int col, int flags);
int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool multiple,
char ***files, int *numfiles, struct EnterState *state);
{
struct Email *msg = mutt_email_new();
- if (mutt_prepare_template(fp, ctx, msg, cur, true) < 0)
+ if (mutt_prepare_template(fp, ctx->mailbox, msg, cur, true) < 0)
{
mutt_email_free(&msg);
return -1;