{
if (mutt_save_message_ctx(e, delete, decode, decrypt, savectx->mailbox) != 0)
{
- mx_mbox_close(&savectx, NULL);
+ mx_mbox_close(&savectx);
return -1;
}
#ifdef USE_COMPRESSED
#endif
if (rc != 0)
{
- mx_mbox_close(&savectx, NULL);
+ mx_mbox_close(&savectx);
return -1;
}
}
const bool need_mailbox_cleanup = ((savectx->mailbox->magic == MUTT_MBOX) ||
(savectx->mailbox->magic == MUTT_MMDF));
- mx_mbox_close(&savectx, NULL);
+ mx_mbox_close(&savectx);
if (need_mailbox_cleanup)
mutt_mailbox_cleanup(buf, &st);
if (!ctx->mailbox->msg_count)
{
- mx_mbox_close(&ctx, NULL);
+ mx_mbox_close(&ctx);
mutt_error(_("No messages in that folder"));
break;
}
menu->redraw |= REDRAW_FULL;
if (close == OP_QUIT)
- mx_mbox_close(&Context, NULL);
+ mx_mbox_close(&Context);
else
{
mx_fastclose_mailbox(Context->mailbox);
rc = mutt_append_message(tmpctx->mailbox, m, cur, 0, chflags);
oerrno = errno;
- mx_mbox_close(&tmpctx, NULL);
+ mx_mbox_close(&tmpctx);
if (rc == -1)
{
if (!msg)
{
mutt_error(_("Can't append to folder: %s"), strerror(errno));
- mx_mbox_close(&tmpctx, NULL);
+ mx_mbox_close(&tmpctx);
goto bail;
}
rc = mx_msg_commit(tmpctx->mailbox, msg);
mx_msg_close(tmpctx->mailbox, &msg);
- mx_mbox_close(&tmpctx, NULL);
+ mx_mbox_close(&tmpctx);
bail:
mutt_file_fclose(&fp);
new_last_folder = mutt_str_strdup(Context->mailbox->path);
*oldcount = Context ? Context->mailbox->msg_count : 0;
- int check = mx_mbox_close(&Context, index_hint);
+ int check = mx_mbox_close(&Context);
if (check != 0)
{
#ifdef USE_INOTIFY
mutt_startup_shutdown_hook(MUTT_SHUTDOWN_HOOK);
- if (!Context || (check = mx_mbox_close(&Context, &index_hint)) == 0)
+ if (!Context || (check = mx_mbox_close(&Context)) == 0)
done = true;
else
{
case OP_MAIN_IMAP_LOGOUT_ALL:
if (Context && Context->mailbox->magic == MUTT_IMAP)
{
- int check = mx_mbox_close(&Context, &index_hint);
+ int check = mx_mbox_close(&Context);
if (check != 0)
{
if ((check == MUTT_NEW_MAIL) || (check == MUTT_REOPENED))
m->msg_unread = ctx->mailbox->msg_unread;
m->msg_flagged = ctx->mailbox->msg_flagged;
m->stats_last_checked = ctx->mailbox->mtime;
- mx_mbox_close(&ctx, NULL);
+ mx_mbox_close(&ctx);
}
}
msg = mx_msg_open_new(ctx->mailbox, en, is_from(buf, NULL, 0, NULL) ? 0 : MUTT_ADD_FROM);
if (!msg)
{
- mx_mbox_close(&ctx, NULL);
+ mx_mbox_close(&ctx);
return -1;
}
if ((ctx->mailbox->magic == MUTT_MBOX) || (ctx->mailbox->magic == MUTT_MMDF))
}
mx_msg_close(ctx->mailbox, &msg);
- mx_mbox_close(&ctx, NULL);
+ mx_mbox_close(&ctx);
return r;
}
else
{
if (mutt_append_message(ctx_trash->mailbox, m, m->emails[i], 0, 0) == -1)
{
- mx_mbox_close(&ctx_trash, NULL);
+ mx_mbox_close(&ctx_trash);
return -1;
}
}
}
- mx_mbox_close(&ctx_trash, NULL);
+ mx_mbox_close(&ctx_trash);
}
else
{
/**
* mx_mbox_close - Save changes and close mailbox
* @param pctx Mailbox
- * @param index_hint Current email
* @retval 0 Success
* @retval -1 Failure
*
* @note Context will be freed after it's closed
*/
-int mx_mbox_close(struct Context **pctx, int *index_hint)
+int mx_mbox_close(struct Context **pctx)
{
if (!pctx || !*pctx)
return 0;
}
else
{
- mx_mbox_close(&f, NULL);
+ mx_mbox_close(&f);
return -1;
}
}
}
- mx_mbox_close(&f, NULL);
+ mx_mbox_close(&f);
}
}
else if (!m->changed && m->msg_deleted == 0)
if (m->changed || (m->msg_deleted != 0))
{
- int check = sync_mailbox(ctx, index_hint);
+ int check = sync_mailbox(ctx, NULL);
if (check != 0)
return check;
}
/* Wrappers for the Mailbox API, see MxOps */
int mx_mbox_check (struct Mailbox *m, int *index_hint);
int mx_mbox_check_stats(struct Mailbox *m, int flags);
-int mx_mbox_close (struct Context **pctx, int *index_hint);
+int mx_mbox_close (struct Context **pctx);
struct Context *mx_mbox_open (struct Mailbox *m, const char *path, int flags);
int mx_mbox_sync (struct Context *ctx, int *index_hint);
int mx_msg_close (struct Mailbox *m, struct Message **msg);
if (ret == -1)
{
- mx_mbox_close(&ctx, NULL);
+ mx_mbox_close(&ctx);
goto fail;
}
if (ret == -2)
msgbuf, i - last, msgs - last);
}
- mx_mbox_close(&ctx, NULL);
+ mx_mbox_close(&ctx);
if (rset)
{
if (PostContext == ctx)
PostContext = NULL;
else
- mx_mbox_close(&PostContext, NULL);
+ mx_mbox_close(&PostContext);
mutt_error(_("No postponed messages"));
return -1;
}
if (PostContext == ctx)
PostContext = NULL;
else
- mx_mbox_close(&PostContext, NULL);
+ mx_mbox_close(&PostContext);
return -1;
}
if (PostContext == ctx)
PostContext = NULL;
else
- mx_mbox_close(&PostContext, NULL);
+ mx_mbox_close(&PostContext);
Delete = opt_delete;
struct ListNode *np, *tmp;
if (!tempfp)
{
mutt_perror(tempfile);
- mx_mbox_close(&f, NULL);
+ mx_mbox_close(&f);
goto done;
}
/* remember new mail status before appending message */
if (!msg)
{
mutt_file_fclose(&tempfp);
- mx_mbox_close(&f, NULL);
+ mx_mbox_close(&f);
goto done;
}
unlink(tempfile);
mx_msg_commit(f->mailbox, msg); /* XXX really? */
mx_msg_close(f->mailbox, &msg);
- mx_mbox_close(&f, NULL);
+ mx_mbox_close(&f);
goto done;
}
else if (finalpath)
*finalpath = mutt_str_strdup(msg->committed_path);
mx_msg_close(f->mailbox, &msg);
- mx_mbox_close(&f, NULL);
+ mx_mbox_close(&f);
if (!post && need_mailbox_cleanup)
mutt_mailbox_cleanup(path, &st);