[PATCH] emacs: make the remaining faces configurable.
[notmuch-archives.git] / 3a / 036f16e7e6f0fc8fcfd80ce93893bff5634475
1 Return-Path: <dkg@fifthhorseman.net>\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 arlo.cworth.org (Postfix) with ESMTP id 05CF96DE09D9\r
6  for <notmuch@notmuchmail.org>; Fri,  8 Jul 2016 03:14:00 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.049\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.049 tagged_above=-999 required=5 tests=[AWL=0.049]\r
12  autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id PLsih2GgQyOT for <notmuch@notmuchmail.org>;\r
16  Fri,  8 Jul 2016 03:13:49 -0700 (PDT)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118])\r
18  by arlo.cworth.org (Postfix) with ESMTP id 603446DE0361\r
19  for <notmuch@notmuchmail.org>; Fri,  8 Jul 2016 03:13:12 -0700 (PDT)\r
20 Received: from fifthhorseman.net (unknown [88.128.80.54])\r
21  by che.mayfirst.org (Postfix) with ESMTPSA id C4D12F99B\r
22  for <notmuch@notmuchmail.org>; Fri,  8 Jul 2016 06:13:11 -0400 (EDT)\r
23 Received: by fifthhorseman.net (Postfix, from userid 1000)\r
24  id AAB5721248; Fri,  8 Jul 2016 11:27:34 +0200 (CEST)\r
25 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
26 To: Notmuch Mail <notmuch@notmuchmail.org>\r
27 Subject: [PATCH v4 08/16] reorganize indexing of multipart/signed and\r
28  multipart/encrypted\r
29 Date: Fri,  8 Jul 2016 11:27:19 +0200\r
30 Message-Id: <1467970047-8013-9-git-send-email-dkg@fifthhorseman.net>\r
31 X-Mailer: git-send-email 2.8.1\r
32 In-Reply-To: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net>\r
33 References: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.20\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38  <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
40  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Fri, 08 Jul 2016 10:14:00 -0000\r
47 \r
48 This prepares the codebase for a cleaner changeset for dealing with\r
49 indexing some encrypted messages in the clear.\r
50 ---\r
51  lib/index.cc | 39 +++++++++++++++++++--------------------\r
52  1 file changed, 19 insertions(+), 20 deletions(-)\r
53 \r
54 diff --git a/lib/index.cc b/lib/index.cc\r
55 index 8c14554..1c030a6 100644\r
56 --- a/lib/index.cc\r
57 +++ b/lib/index.cc\r
58 @@ -333,27 +333,26 @@ _index_mime_part (notmuch_message_t *message,\r
59         GMimeMultipart *multipart = GMIME_MULTIPART (part);\r
60         int i;\r
61  \r
62 -       if (GMIME_IS_MULTIPART_SIGNED (multipart))\r
63 -         _notmuch_message_add_term (message, "tag", "signed");\r
64 -\r
65 -       if (GMIME_IS_MULTIPART_ENCRYPTED (multipart))\r
66 -         _notmuch_message_add_term (message, "tag", "encrypted");\r
67 -\r
68 -       for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {\r
69 -           if (GMIME_IS_MULTIPART_SIGNED (multipart)) {\r
70 -               /* Don't index the signature. */\r
71 -               if (i == 1)\r
72 -                   continue;\r
73 -               if (i > 1)\r
74 -                   _notmuch_database_log (_notmuch_message_database (message),\r
75 -                                         "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");\r
76 -           }\r
77 -           if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {\r
78 -               /* Don't index encrypted parts. */\r
79 -               continue;\r
80 -           }\r
81 +       if (GMIME_IS_MULTIPART_SIGNED (multipart)) {\r
82 +           _notmuch_message_add_term (message, "tag", "signed");\r
83 +           /* FIXME: should we try to validate the signature? */\r
84 +           \r
85 +           /* FIXME: is it always just the first part that is signed in\r
86 +            all multipart/signed messages?*/\r
87             _index_mime_part (message,\r
88 -                             g_mime_multipart_get_part (multipart, i));\r
89 +                             g_mime_multipart_get_part (multipart, 0));\r
90 +           \r
91 +           if (g_mime_multipart_get_count (multipart) > 2)\r
92 +               _notmuch_database_log (_notmuch_message_database (message),\r
93 +                                      "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");\r
94 +       } else if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {\r
95 +           /* Don't index encrypted parts */\r
96 +           _notmuch_message_add_term (message, "tag", "encrypted");\r
97 +       } else {\r
98 +           for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {\r
99 +               _index_mime_part (message,\r
100 +                                 g_mime_multipart_get_part (multipart, i));\r
101 +           }\r
102         }\r
103         return;\r
104      }\r
105 -- \r
106 2.8.1\r
107 \r