From a2c303e82a7048e464fc00e9df91c8c4ef99a9e5 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 22 Nov 2018 11:49:23 +0000 Subject: [PATCH] factor out Context from mutt_newsgroup_uncatchup() --- browser.c | 2 +- nntp/newsrc.c | 5 ++--- nntp/nntp.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/browser.c b/browser.c index af788840f..934795fcb 100644 --- a/browser.c +++ b/browser.c @@ -2052,7 +2052,7 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int if (i == OP_CATCHUP) mdata = mutt_newsgroup_catchup(Context->mailbox, CurrentNewsSrv, ff->name); else - mdata = mutt_newsgroup_uncatchup(Context, CurrentNewsSrv, ff->name); + mdata = mutt_newsgroup_uncatchup(Context->mailbox, CurrentNewsSrv, ff->name); if (mdata) { diff --git a/nntp/newsrc.c b/nntp/newsrc.c index 6bea251cc..d37a82787 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -1313,13 +1313,13 @@ struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, /** * mutt_newsgroup_uncatchup - Uncatchup newsgroup - * @param ctx Mailbox + * @param m Mailbox * @param adata NNTP server * @param group Newsgroup * @retval ptr NNTP data * @retval NULL Error */ -struct NntpMboxData *mutt_newsgroup_uncatchup(struct Context *ctx, +struct NntpMboxData *mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group) { struct NntpMboxData *mdata = NULL; @@ -1338,7 +1338,6 @@ struct NntpMboxData *mutt_newsgroup_uncatchup(struct Context *ctx, mdata->newsrc_ent[0].first = 1; mdata->newsrc_ent[0].last = mdata->first_message - 1; } - struct Mailbox *m = ctx ? ctx->mailbox : NULL; if (m && m->mdata == mdata) { mdata->unread = m->msg_count; diff --git a/nntp/nntp.h b/nntp/nntp.h index f6b92a40f..9275aef8b 100644 --- a/nntp/nntp.h +++ b/nntp/nntp.h @@ -154,7 +154,7 @@ struct NntpAccountData *nntp_select_server(struct Mailbox *m, char *server, bool struct NntpMboxData *mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group); struct NntpMboxData *mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group); struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group); -struct NntpMboxData *mutt_newsgroup_uncatchup(struct Context *ctx, struct NntpAccountData *adata, char *group); +struct NntpMboxData *mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group); int nntp_active_fetch(struct NntpAccountData *adata, bool new); int nntp_newsrc_update(struct NntpAccountData *adata); int nntp_post(struct Mailbox *m, const char *msg); -- 2.40.0