From: Richard Russon Date: Thu, 22 Nov 2018 12:45:21 +0000 (+0000) Subject: factor out Context from mutt_check_rescore() X-Git-Tag: 2019-10-25~500^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f93bccc10d08c441a81d6cc3c276751cd2158885;p=neomutt factor out Context from mutt_check_rescore() --- diff --git a/index.c b/index.c index e8f16dd82..ee5463555 100644 --- a/index.c +++ b/index.c @@ -3013,7 +3013,7 @@ int mutt_index_menu(void) case OP_ENTER_COMMAND: mutt_enter_command(); - mutt_check_rescore(Context); + mutt_check_rescore(Context->mailbox); break; case OP_EDIT_OR_VIEW_RAW_MESSAGE: diff --git a/score.c b/score.c index ed198a144..9069d9559 100644 --- a/score.c +++ b/score.c @@ -59,9 +59,9 @@ static struct Score *ScoreList = NULL; /** * mutt_check_rescore - Do the emails need to have their scores recalculated? - * @param ctx Mailbox + * @param m Mailbox */ -void mutt_check_rescore(struct Context *ctx) +void mutt_check_rescore(struct Mailbox *m) { if (OptNeedRescore && Score) { @@ -76,10 +76,10 @@ void mutt_check_rescore(struct Context *ctx) mutt_menu_set_redraw_full(MENU_MAIN); mutt_menu_set_redraw_full(MENU_PAGER); - for (int i = 0; ctx && i < ctx->mailbox->msg_count; i++) + for (int i = 0; m && i < m->msg_count; i++) { - mutt_score_message(ctx->mailbox, ctx->mailbox->hdrs[i], true); - ctx->mailbox->hdrs[i]->pair = 0; + mutt_score_message(m, m->hdrs[i], true); + m->hdrs[i]->pair = 0; } } OptNeedRescore = false; diff --git a/score.h b/score.h index f1fd74d0b..2f054cba7 100644 --- a/score.h +++ b/score.h @@ -26,7 +26,6 @@ #include struct Buffer; -struct Context; struct Email; struct Mailbox; @@ -35,7 +34,7 @@ extern short ScoreThresholdDelete; extern short ScoreThresholdFlag; extern short ScoreThresholdRead; -void mutt_check_rescore(struct Context *ctx); +void mutt_check_rescore(struct Mailbox *m); int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err); int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err); void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_ctx);