]> granicus.if.org Git - neomutt/commitdiff
factor out Context from mutt_newsgroup_uncatchup()
authorRichard Russon <rich@flatcap.org>
Thu, 22 Nov 2018 11:49:23 +0000 (11:49 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 22 Nov 2018 13:45:24 +0000 (13:45 +0000)
browser.c
nntp/newsrc.c
nntp/nntp.h

index af788840fee68220ed6142c60cfce4ba253df77f..934795fcbafb95de6da69f2b829573252f25b691 100644 (file)
--- 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)
           {
index 6bea251cc71f6535446eb981001fb5b3da5f26f1..d37a82787d6165998fc7c6e18e12a99605c0d67f 100644 (file)
@@ -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;
index f6b92a40f5d7ebc1e897064baec0f8835859a0a1..9275aef8b7a2484cee17da98cfa5f6e039b85738 100644 (file)
@@ -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);