[Patch v5 6/8] lib: add private function to extract the database for a message.
[notmuch-archives.git] / 6e / 1779cdf6aaec1d461bd11a8d120614f52bad0f
1 Return-Path: <markwalters1009@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 81E76429E54\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 17:18:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id NrkpahntNI8t for <notmuch@notmuchmail.org>;\r
18         Mon, 23 Jan 2012 17:18:09 -0800 (PST)\r
19 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
20         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id D4EA4429E21\r
23         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 17:18:08 -0800 (PST)\r
24 Received: by mail-we0-f181.google.com with SMTP id b10so3021166wer.26\r
25         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 17:18:08 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=bfevquQ8dxwQhJdMCbxkQXnh+9BrUMQ9fI+oDFnFf9w=;\r
29         b=SzZtZnQ2sbEKDSqVqHpx3JZAuEzcBUhZQrI67ciEBJSIqMC337S2VkBRELNuFH5YC7\r
30         3ZUmQPlAOG0IoAld48vKYEcr1Q4jzH0UXoqGtITBxZMnibomuQ8ij7SR1bUzLrBtZMhi\r
31         r/JU1APtTn17S2zgCZ05qR54FGQ1yH8CVAb+k=\r
32 Received: by 10.216.133.26 with SMTP id p26mr1990wei.36.1327367888578;\r
33         Mon, 23 Jan 2012 17:18:08 -0800 (PST)\r
34 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
35  [94.192.233.223])      by mx.google.com with ESMTPS id\r
36  di5sm46967680wib.3.2012.01.23.17.18.07 (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Mon, 23 Jan 2012 17:18:07 -0800 (PST)\r
38 From: Mark Walters <markwalters1009@gmail.com>\r
39 To: notmuch@notmuchmail.org,\r
40         Austin Clements <amdragon@MIT.EDU>\r
41 Subject: [PATCH 4/4] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag\r
42 Date: Tue, 24 Jan 2012 01:18:43 +0000\r
43 Message-Id: <1327367923-18228-4-git-send-email-markwalters1009@gmail.com>\r
44 X-Mailer: git-send-email 1.7.2.3\r
45 In-Reply-To: <20120124011609.GX16740@mit.edu>\r
46 References: <20120124011609.GX16740@mit.edu>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Tue, 24 Jan 2012 01:18:09 -0000\r
60 \r
61 Make notmuch-search.c respect the NOTMUCH_MESSAGE_FLAG_EXCLUDED.  All tests\r
62 should pass: i.e., the behaviour should be the same as before the\r
63 series.\r
64 \r
65 ---\r
66  notmuch-search.c |    5 ++++-\r
67  1 files changed, 4 insertions(+), 1 deletions(-)\r
68 \r
69 diff --git a/notmuch-search.c b/notmuch-search.c\r
70 index 8867aab..b005abf 100644\r
71 --- a/notmuch-search.c\r
72 +++ b/notmuch-search.c\r
73 @@ -227,7 +227,7 @@ do_search_threads (const search_format_t *format,\r
74  \r
75         thread = notmuch_threads_get (threads);\r
76  \r
77 -       if (i < offset) {\r
78 +       if ((i < offset) || (notmuch_thread_get_matched_messages (thread) == 0)) {\r
79             notmuch_thread_destroy (thread);\r
80             continue;\r
81         }\r
82 @@ -318,6 +318,9 @@ do_search_messages (const search_format_t *format,\r
83  \r
84         message = notmuch_messages_get (messages);\r
85  \r
86 +       if (notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_EXCLUDED))\r
87 +           continue;\r
88 +\r
89         if (output == OUTPUT_FILES) {\r
90             filenames = notmuch_message_get_filenames (message);\r
91  \r
92 -- \r
93 1.7.2.3\r
94 \r