]> granicus.if.org Git - neomutt/commitdiff
bypass data limit when expanding threads
authorChris Mason <clm@fb.com>
Wed, 23 Oct 2013 18:34:57 +0000 (11:34 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 14 Mar 2016 23:11:43 +0000 (23:11 +0000)
OP_MAIN_ENTIRE_THREAD will expand a partial thread, but it turns
into a noop when a given query is over the data limit.

This pushes the data limit calculation into the callers of
read_threads_query so the thread expansion code can by pass the
original data limit.

Signed-off-by: Chris Mason <clm@fb.com>
mutt_notmuch.c

index 7e8bd3c7a46b8aa1e3a6387367b2240f10a370fb..1a39249d45353ac9e9a7940219d9c2765a89eca9 100644 (file)
@@ -1093,17 +1093,14 @@ static void read_mesgs_query(CONTEXT *ctx, notmuch_query_t *q, int dedup)
        }
 }
 
-static void read_threads_query(CONTEXT *ctx, notmuch_query_t *q, int dedup)
+static void read_threads_query(CONTEXT *ctx, notmuch_query_t *q, int dedup, int limit)
 {
        struct nm_ctxdata *data = get_ctxdata(ctx);
-       int limit;
        notmuch_threads_t *threads;
 
        if (!data)
                return;
 
-       limit = get_limit(data);
-
        for (threads = notmuch_query_search_threads(q);
             notmuch_threads_valid(threads) &&
                (limit == 0 || ctx->msgcount < limit);
@@ -1140,7 +1137,7 @@ int nm_read_query(CONTEXT *ctx)
                        read_mesgs_query(ctx, q, 0);
                        break;
                case NM_QUERY_TYPE_THREADS:
-                       read_threads_query(ctx, q, 0);
+                       read_threads_query(ctx, q, 0, get_limit(data));
                        break;
                }
                notmuch_query_destroy(q);
@@ -1193,7 +1190,7 @@ int nm_read_entire_thread(CONTEXT *ctx, HEADER *h)
        apply_exclude_tags(q);
        notmuch_query_set_sort(q, NOTMUCH_SORT_NEWEST_FIRST);
 
-       read_threads_query(ctx, q, 1);
+       read_threads_query(ctx, q, 1, 0);
        ctx->mtime = time(NULL);
        rc = 0;