]> granicus.if.org Git - neomutt/commitdiff
improve entire-thread
authorKarel Zak <kzak@redhat.com>
Sun, 13 Oct 2013 18:34:57 +0000 (11:34 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 15:30:07 +0000 (16:30 +0100)
 - don't support mutt tags, always work with the current message only

 - support collapsed threads

 - add "No more messages in the thread" message

Signed-off-by: Karel Zak <kzak@redhat.com>
curs_main.c
mutt_notmuch.c

index e7a6231a8547a9d008483eb75bcb29c0ae5907cd..11ca9f755768749f79f264cd9a9fde87c39500b6 100644 (file)
@@ -1393,29 +1393,22 @@ int mutt_index_menu (void)
        }
        CHECK_MSGCOUNT;
         CHECK_VISIBLE;
-       if (tag)
-       {
-         nm_longrun_init(Context, FALSE);
-         for (j = 0; j < Context->vcount; j++) {
-           if (Context->hdrs[Context->v2r[j]]->tagged)
-             nm_read_entire_thread(Context, Context->hdrs[Context->v2r[j]]);
-         }
-         nm_longrun_done(Context);
-       }
-       else
-       {
-         if (nm_read_entire_thread(Context, CURHDR) < 0) {
-           mutt_message _("Failed to read thread, aborting.");
-           break;
-         }
+       if (nm_read_entire_thread(Context, CURHDR) < 0) {
+          mutt_message _("Failed to read thread, aborting.");
+          break;
        }
        if (oldcount < Context->msgcount) {
                HEADER *oldcur = CURHDR;
 
                if ((Sort & SORT_MASK) == SORT_THREADS)
-                       mutt_sort_headers (Context, 1);
+                       mutt_sort_headers (Context, 0);
                menu->current = oldcur->virtual;
                menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
+
+               if (oldcur->collapsed || Context->collapsed) {
+                       menu->current = mutt_uncollapse_thread(Context, CURHDR);
+                       mutt_set_virtual(Context);
+               }
        }
        break;
       }
index 3b54627ff31aa59175d0184885cf11b46c9e7935..5e6e5a367c9c118d39eaa6938176cdd87803c804 100644 (file)
@@ -1165,6 +1165,9 @@ done:
        if (!is_longrun(data))
                release_db(data);
 
+       if (ctx->msgcount == data->oldmsgcount)
+               mutt_message _("No more messages in the thread.");
+
        data->oldmsgcount = 0;
        dprint(1, (debugfile, "nm: reading entire-thread messages... done [rc=%d, count=%d]\n",
                                rc, ctx->msgcount));