From: Richard Russon Date: Tue, 16 Jul 2019 17:08:38 +0000 (+0100) Subject: de-Context nntp_check_msgid() X-Git-Tag: 2019-10-25~131^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27273938db49a6c07a9b28eae57dcda91c9d99ec;p=neomutt de-Context nntp_check_msgid() --- diff --git a/index.c b/index.c index b674b2d43..49bf8a1f4 100644 --- a/index.c +++ b/index.c @@ -1403,7 +1403,7 @@ int mutt_index_menu(void) else { mutt_message(_("Fetching %s from server..."), buf); - int rc = nntp_check_msgid(Context, buf); + int rc = nntp_check_msgid(Context->mailbox, buf); if (rc == 0) { e = Context->mailbox->emails[Context->mailbox->msg_count - 1]; @@ -1449,7 +1449,7 @@ int mutt_index_menu(void) { if (!mutt_hash_find(Context->mailbox->id_hash, ref->data)) { - rc = nntp_check_msgid(Context, ref->data); + rc = nntp_check_msgid(Context->mailbox, ref->data); if (rc < 0) break; } diff --git a/nntp/nntp.c b/nntp/nntp.c index af8262899..3e764e014 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -2214,19 +2214,17 @@ int nntp_check_new_groups(struct Mailbox *m, struct NntpAccountData *adata) /** * nntp_check_msgid - Fetch article by Message-ID - * @param ctx Mailbox + * @param m Mailbox * @param msgid Message ID * @retval 0 Success * @retval 1 No such article * @retval -1 Error */ -int nntp_check_msgid(struct Context *ctx, const char *msgid) +int nntp_check_msgid(struct Mailbox *m, const char *msgid) { - if (!ctx || !ctx->mailbox) + if (!m) return -1; - struct Mailbox *m = ctx->mailbox; - struct NntpMboxData *mdata = m->mdata; char buf[1024]; @@ -2281,7 +2279,7 @@ int nntp_check_msgid(struct Context *ctx, const char *msgid) e->changed = true; e->received = e->date_sent; e->index = m->msg_count++; - ctx_update(ctx); + mailbox_changed(m, MBN_INVALID); return 0; } diff --git a/nntp/nntp.h b/nntp/nntp.h index da2189054..5c1fd2653 100644 --- a/nntp/nntp.h +++ b/nntp/nntp.h @@ -164,7 +164,7 @@ struct NntpMboxData *mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAcco int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new); int nntp_newsrc_update(struct NntpAccountData *adata); int nntp_post(struct Mailbox *m, const char *msg); -int nntp_check_msgid(struct Context *ctx, const char *msgid); +int nntp_check_msgid(struct Mailbox *m, const char *msgid); int nntp_check_children(struct Context *ctx, const char *msgid); int nntp_newsrc_parse(struct NntpAccountData *adata); void nntp_newsrc_close(struct NntpAccountData *adata);