]> granicus.if.org Git - neomutt/commitdiff
move Context.new
authorMehdi Abaakouk <sileht@sileht.net>
Fri, 9 Nov 2018 12:33:10 +0000 (13:33 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 9 Nov 2018 12:51:15 +0000 (12:51 +0000)
flags.c
mailbox.c
mailbox.h
mbox/mbox.c
mx.c
nntp/nntp.c

diff --git a/flags.c b/flags.c
index d94dc1c0390c40787137c341b85f17ede5a5b060..4a79ee94a70f2fb866733434a30bde35bc4a7315 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -147,7 +147,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
           update = true;
           e->old = false;
           if (upd_ctx)
-            ctx->new ++;
+            ctx->mailbox->msg_new ++;
           if (e->read)
           {
             e->read = false;
@@ -164,7 +164,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
         update = true;
         if (!e->old)
           if (upd_ctx)
-            ctx->new --;
+            ctx->mailbox->msg_new --;
         e->read = true;
         if (upd_ctx)
           ctx->mailbox->msg_unread--;
@@ -187,7 +187,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
           e->old = true;
           if (!e->read)
             if (upd_ctx)
-              ctx->new --;
+              ctx->mailbox->msg_new --;
           e->changed = true;
           if (upd_ctx)
             ctx->mailbox->changed = true;
@@ -199,7 +199,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
         e->old = false;
         if (!e->read)
           if (upd_ctx)
-            ctx->new ++;
+            ctx->mailbox->msg_new ++;
         e->changed = true;
         if (upd_ctx)
           ctx->mailbox->changed = true;
@@ -221,7 +221,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
             ctx->mailbox->msg_unread--;
           if (!e->old)
             if (upd_ctx)
-              ctx->new --;
+              ctx->mailbox->msg_new --;
           e->changed = true;
           if (upd_ctx)
             ctx->mailbox->changed = true;
@@ -235,7 +235,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
           ctx->mailbox->msg_unread++;
         if (!e->old)
           if (upd_ctx)
-            ctx->new ++;
+            ctx->mailbox->msg_new ++;
         e->changed = true;
         if (upd_ctx)
           ctx->mailbox->changed = true;
@@ -260,7 +260,7 @@ void mutt_set_flag_update(struct Context *ctx, struct Email *e, int flag, bool b
               ctx->mailbox->msg_unread--;
             if (!e->old)
               if (upd_ctx)
-                ctx->new --;
+                ctx->mailbox->msg_new --;
           }
           e->changed = true;
           if (upd_ctx)
index f00ca00307284196c5b16dc7a2f9592ef295ee87..38b2f3a74ef03ad22b1fc181d344d17e333ae947 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -223,6 +223,7 @@ static int mailbox_maildir_check(struct Mailbox *m, bool check_stats)
     m->msg_count = 0;
     m->msg_unread = 0;
     m->msg_flagged = 0;
+    m->msg_new = 0;
   }
 
   rc = mailbox_maildir_check_dir(m, "new", check_new, check_stats);
index 92ef85b2a9bd31e19c20b78256d4a0d61d0d0611..65507c168e67f049cb2485ebb4fdcaa0248e1244 100644 (file)
--- a/mailbox.h
+++ b/mailbox.h
@@ -87,6 +87,7 @@ struct Mailbox
   int msg_count;             /**< total number of messages */
   int msg_unread;            /**< number of unread messages */
   int msg_flagged;           /**< number of flagged messages */
+  int msg_new;               /**< number of new messages */
 
   struct Email **hdrs;
   int hdrmax;               /**< number of pointers in hdrs */
index bc74cad8cdbfb123d00985e9332cf491d854a729..03b9204568aeaa645170010c2f787dd7a746d659 100644 (file)
@@ -614,7 +614,7 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
   ctx->vsize = 0;
   ctx->tagged = 0;
   ctx->deleted = 0;
-  ctx->new = 0;
+  ctx->mailbox->msg_new = 0;
   ctx->mailbox->msg_unread = 0;
   ctx->mailbox->msg_flagged = 0;
   ctx->mailbox->changed = false;
diff --git a/mx.c b/mx.c
index d6d94f04de7c6606b9189b8605b643d7c305e7a5..a3c7e887532ea0888c8e59b9ff1b3b56aface54d 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -832,7 +832,7 @@ void mx_update_tables(struct Context *ctx, bool committing)
   ctx->vsize = 0;
   ctx->tagged = 0;
   ctx->deleted = 0;
-  ctx->new = 0;
+  ctx->mailbox->msg_new = 0;
   ctx->mailbox->msg_unread = 0;
   ctx->mailbox->changed = false;
   ctx->mailbox->msg_flagged = 0;
@@ -877,7 +877,7 @@ void mx_update_tables(struct Context *ctx, bool committing)
       {
         ctx->mailbox->msg_unread++;
         if (!ctx->mailbox->hdrs[j]->old)
-          ctx->new ++;
+          ctx->mailbox->msg_new ++;
       }
 
       j++;
@@ -1294,7 +1294,7 @@ void mx_update_context(struct Context *ctx, int new_messages)
     {
       ctx->mailbox->msg_unread++;
       if (!e->old)
-        ctx->new ++;
+        ctx->mailbox->msg_new ++;
     }
   }
 }
index 5f12eb48d07be589ff4ba98d1a39ff29d1532ef2..946cd1300f10884cdc22e9b066607c129d0245ec 100644 (file)
@@ -1691,7 +1691,7 @@ static int check_mailbox(struct Context *ctx)
 
     ctx->mailbox->vcount = 0;
     ctx->deleted = 0;
-    ctx->new = 0;
+    ctx->mailbox->msg_new = 0;
     ctx->mailbox->msg_unread = 0;
     ctx->mailbox->msg_flagged = 0;
     ctx->mailbox->changed = false;