From: Chris Mason Date: Wed, 23 Oct 2013 18:34:57 +0000 (-0700) Subject: bypass data limit when expanding threads X-Git-Tag: neomutt-20160317~5^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e2caf20a75f3157aeaef0c1343da0b8fac20d84;p=neomutt bypass data limit when expanding threads 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 --- diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 7e8bd3c7a..1a39249d4 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -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;