]> granicus.if.org Git - neomutt/commitdiff
mbox_sync: use mailbox notifications
authorRichard Russon <rich@flatcap.org>
Wed, 26 Dec 2018 18:10:36 +0000 (18:10 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 5 Jan 2019 14:44:35 +0000 (14:44 +0000)
mbox/mbox.c
nntp/newsrc.c
nntp/nntp.c
nntp/nntp_private.h

index 7946955ec3d43eddd0ff6cb8f96ffde45ff234c4..f865df460b9480c6fc86dc13f339bc83da815fcd 100644 (file)
@@ -1159,7 +1159,7 @@ static int mbox_mbox_sync(struct Context *ctx, int *index_hint)
   {
     save_sort = Sort;
     Sort = SORT_ORDER;
-    mutt_sort_headers(ctx, false);
+    mutt_mailbox_changed(m, MBN_RESORT);
     Sort = save_sort;
     need_sort = 1;
   }
@@ -1497,7 +1497,7 @@ bail: /* Come here in case of disaster */
   {
     /* if the mailbox was reopened, the thread tree will be invalid so make
      * sure to start threading from scratch.  */
-    mutt_sort_headers(ctx, (need_sort == MUTT_REOPENED));
+    mutt_mailbox_changed(m, MBN_RESORT);
   }
 
   return rc;
index c1694b7e274206cee9b56e96baa1a21180e5cf65..30104912e7040c4ddcbd1ff670b4318be62e6b05 100644 (file)
@@ -294,15 +294,13 @@ int nntp_newsrc_parse(struct NntpAccountData *adata)
 
 /**
  * nntp_newsrc_gen_entries - Generate array of .newsrc entries
- * @param ctx Mailbox
+ * @param m Mailbox
  */
-void nntp_newsrc_gen_entries(struct Context *ctx)
+void nntp_newsrc_gen_entries(struct Mailbox *m)
 {
-  if (!ctx || !ctx->mailbox)
+  if (!m)
     return;
 
-  struct Mailbox *m = ctx->mailbox;
-
   struct NntpMboxData *mdata = m->mdata;
   anum_t last = 0, first = 1;
   bool series;
@@ -313,7 +311,7 @@ void nntp_newsrc_gen_entries(struct Context *ctx)
   {
     save_sort = Sort;
     Sort = SORT_ORDER;
-    mutt_sort_headers(ctx, false);
+    mutt_mailbox_changed(m, MBN_RESORT);
   }
 
   entries = mdata->newsrc_len;
@@ -378,7 +376,7 @@ void nntp_newsrc_gen_entries(struct Context *ctx)
   if (save_sort != Sort)
   {
     Sort = save_sort;
-    mutt_sort_headers(ctx, false);
+    mutt_mailbox_changed(m, MBN_RESORT);
   }
 }
 
index 09be2b3a761343164d7a792357af7397d0956fc8..29ad5aab1602832f73b18195dc95d51ccbac32ca 100644 (file)
@@ -2662,7 +2662,7 @@ static int nntp_mbox_sync(struct Context *ctx, int *index_hint)
 #endif
 
   /* save .newsrc entries */
-  nntp_newsrc_gen_entries(ctx);
+  nntp_newsrc_gen_entries(ctx->mailbox);
   nntp_newsrc_update(mdata->adata);
   nntp_newsrc_close(mdata->adata);
   return 0;
index 1a25d0a688b630bb59278c4ff174502fbf041c3a..daab1555e48dd3d2384bc5e4332ed5637447ff0d 100644 (file)
@@ -59,7 +59,7 @@ struct NntpEmailData *nntp_edata_get(struct Email *e);
 void nntp_group_unread_stat(struct NntpMboxData *mdata);
 void nntp_hash_destructor_t(int type, void *obj, intptr_t data);
 void nntp_mdata_free(void **ptr);
-void nntp_newsrc_gen_entries(struct Context *ctx);
+void nntp_newsrc_gen_entries(struct Mailbox *m);
 int  nntp_open_connection(struct NntpAccountData *adata);
 void nntp_article_status(struct Mailbox *m, struct Email *e, char *group, anum_t anum);