]> granicus.if.org Git - neomutt/commitdiff
de-Context nntp_check_msgid()
authorRichard Russon <rich@flatcap.org>
Tue, 16 Jul 2019 17:08:38 +0000 (18:08 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 16 Jul 2019 18:01:35 +0000 (19:01 +0100)
index.c
nntp/nntp.c
nntp/nntp.h

diff --git a/index.c b/index.c
index b674b2d439a5379c093b7fafd7bf9e02e549c6c3..49bf8a1f4f1b5b5bb5b8f99087ce1f615c3ae198 100644 (file)
--- 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;
               }
index af82628990e6b07fdd7b28a4f9cdaa5980db7334..3e764e0145a19b6a94f5264392e52f1f7ae1a213 100644 (file)
@@ -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;
 }
 
index da218905446638726c63463e447a334fd5f4c5ad..5c1fd2653b5bfb814111a8c0c1f7ecdc0cc54078 100644 (file)
@@ -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);