int maildir_parse_dir (struct Mailbox *m, struct Maildir ***last, const char *subdir, int *count, struct Progress *progress);
void maildir_parse_flags (struct Email *e, const char *path);
struct Email * maildir_parse_message (enum MailboxType magic, const char *fname, bool is_old, struct Email *e);
-void maildir_update_tables (struct Context *ctx, int *index_hint);
int md_commit_message (struct Mailbox *m, struct Message *msg, struct Email *e);
int mh_commit_msg (struct Mailbox *m, struct Message *msg, struct Email *e, bool updseq);
int mh_mkstemp (struct Mailbox *m, FILE **fp, char **tgt);
}
}
-/**
- * maildir_update_tables - Update the Email tables
- * @param ctx Mailbox
- * @param index_hint Current Email in index
- */
-void maildir_update_tables(struct Context *ctx, int *index_hint)
-{
- if (!ctx || !ctx->mailbox)
- return;
-
- struct Mailbox *m = ctx->mailbox;
-
- if (C_Sort != SORT_ORDER)
- {
- const enum SortType old_sort = C_Sort;
- C_Sort = SORT_ORDER;
- mutt_sort_headers(ctx, true);
- C_Sort = old_sort;
- }
-
- const int old_count = m->msg_count;
- for (int i = 0, j = 0; i < old_count; i++)
- {
- if (m->emails[i]->active && index_hint && (*index_hint == i))
- *index_hint = j;
-
- if (m->emails[i]->active)
- m->emails[i]->index = j++;
- }
-
- ctx_update_tables(ctx, false);
- mutt_clear_threads(ctx);
-}
-
/**
* md_open_find_message - Find a message in a maildir folder
* @param[in] folder Base folder