Searching for phrases in the body of an email
[notmuch-archives.git] / eb / 4ccf81e1327acad59f12789e7f3bda6957d598
1 Return-Path: <todd@electricoding.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 BFC01431FD9\r
6         for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 15:44:33 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 2.438\r
11 X-Spam-Level: **\r
12 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
13         tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id qPwwSPIimpKP for <notmuch@notmuchmail.org>;\r
17         Thu, 22 Jan 2015 15:44:31 -0800 (PST)\r
18 Received: from s75.web-hosting.com (s75.web-hosting.com [198.187.31.9])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id E7E85431FD2\r
22         for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 15:44:24 -0800 (PST)\r
23 Received: from user-69-73-37-128.knology.net ([69.73.37.128]:32799\r
24         helo=localhost.localdomain)\r
25         by server75.web-hosting.com with esmtpsa (UNKNOWN:AES128-SHA256:128)\r
26         (Exim 4.82) (envelope-from <todd@electricoding.com>)\r
27         id 1YERQE-0036iE-JF; Thu, 22 Jan 2015 18:44:22 -0500\r
28 From: Todd <todd@electricoding.com>\r
29 To: notmuch@notmuchmail.org\r
30 Subject: [PATCH v4 2/5] Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES database\r
31         feature\r
32 Date: Thu, 22 Jan 2015 17:43:37 -0600\r
33 Message-Id: <1421970220-9019-3-git-send-email-todd@electricoding.com>\r
34 X-Mailer: git-send-email 1.9.1\r
35 In-Reply-To: <1421970220-9019-1-git-send-email-todd@electricoding.com>\r
36 References: <1421970220-9019-1-git-send-email-todd@electricoding.com>\r
37 In-Reply-To: <1420849787-4401-1-git-send-email-todd@electricoding.com>\r
38 References: <1420849787-4401-1-git-send-email-todd@electricoding.com>\r
39 X-AntiAbuse: This header was added to track abuse,\r
40         please include it with any abuse report\r
41 X-AntiAbuse: Primary Hostname - server75.web-hosting.com\r
42 X-AntiAbuse: Original Domain - notmuchmail.org\r
43 X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]\r
44 X-AntiAbuse: Sender Address Domain - electricoding.com\r
45 X-Get-Message-Sender-Via: server75.web-hosting.com: authenticated_id:\r
46         todd@electricoding.com\r
47 X-Source: \r
48 X-Source-Args: \r
49 X-Source-Dir: \r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Thu, 22 Jan 2015 23:44:34 -0000\r
63 \r
64 This feature will exist in all newly created databases, but there is\r
65 no upgrade provided for it.  If this flag exists, it indicates that\r
66 the database was created after the indexed MIME-types feature was\r
67 added.\r
68 ---\r
69  lib/database-private.h | 15 ++++++++++++---\r
70  lib/database.cc        | 10 ++++++++--\r
71  2 files changed, 20 insertions(+), 5 deletions(-)\r
72 \r
73 diff --git a/lib/database-private.h b/lib/database-private.h\r
74 index 15e03cc..6d6fa2c 100644\r
75 --- a/lib/database-private.h\r
76 +++ b/lib/database-private.h\r
77 @@ -92,6 +92,14 @@ enum _notmuch_features {\r
78       *\r
79       * Introduced: version 3. */\r
80      NOTMUCH_FEATURE_GHOSTS = 1 << 4,\r
81 +\r
82 +\r
83 +    /* If set, then the database was created after the introduction of\r
84 +     * indexed mime types. If unset, then the database may contain a\r
85 +     * mixture of messages with indexed and non-indexed mime types.\r
86 +     *\r
87 +     * Introduced: version 3. */\r
88 +    NOTMUCH_FEATURE_INDEXED_MIMETYPES = 1 << 5,\r
89  };\r
90  \r
91  /* In C++, a named enum is its own type, so define bitwise operators\r
92 @@ -161,9 +169,10 @@ struct _notmuch_database {\r
93  \r
94  /* Current database features.  If any of these are missing from a\r
95   * database, request an upgrade.\r
96 - * NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES is not included because\r
97 - * upgrade doesn't currently introduce the feature (though brand new\r
98 - * databases will have it). */\r
99 + * NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES and\r
100 + * NOTMUCH_FEATURE_INDEXED_MIMETYPES are not included because upgrade\r
101 + * doesn't currently introduce the features (though brand new databases\r
102 + * will have it). */\r
103  #define NOTMUCH_FEATURES_CURRENT \\r
104      (NOTMUCH_FEATURE_FILE_TERMS | NOTMUCH_FEATURE_DIRECTORY_DOCS | \\r
105       NOTMUCH_FEATURE_BOOL_FOLDER | NOTMUCH_FEATURE_GHOSTS)\r
106 diff --git a/lib/database.cc b/lib/database.cc\r
107 index 3601f9d..0d2c417 100644\r
108 --- a/lib/database.cc\r
109 +++ b/lib/database.cc\r
110 @@ -304,6 +304,11 @@ static const struct {\r
111        "exact folder:/path: search", "rw" },\r
112      { NOTMUCH_FEATURE_GHOSTS,\r
113        "mail documents for missing messages", "w"},\r
114 +    /* Knowledge of the index mime-types are not required for reading\r
115 +     * a database because a reader will just be unable to query\r
116 +     * them. */\r
117 +    { NOTMUCH_FEATURE_INDEXED_MIMETYPES,\r
118 +      "indexed MIME types", "w"},\r
119  };\r
120  \r
121  const char *\r
122 @@ -646,9 +651,10 @@ notmuch_database_create (const char *path, notmuch_database_t **database)\r
123      if (status)\r
124         goto DONE;\r
125  \r
126 -    /* Upgrade doesn't add this feature to existing databases, but new\r
127 -     * databases have it. */\r
128 +    /* Upgrade doesn't add these feature to existing databases, but\r
129 +     * new databases have them. */\r
130      notmuch->features |= NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES;\r
131 +    notmuch->features |= NOTMUCH_FEATURE_INDEXED_MIMETYPES;\r
132  \r
133      status = notmuch_database_upgrade (notmuch, NULL, NULL);\r
134      if (status) {\r
135 -- \r
136 1.9.1\r
137 \r