[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / cd / 9b1c06fd0fa7437f1a457c4b2a1e5e963eaa5f
1 Return-Path: <david@tethera.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 D2C246DE0243\r
6  for <notmuch@notmuchmail.org>; Tue,  5 Apr 2016 19:05:07 -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.02\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
12   SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 VKNs-ji5hHFV for <notmuch@notmuchmail.org>;\r
16  Tue,  5 Apr 2016 19:04:59 -0700 (PDT)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id 6196F6DE01F7\r
19  for <notmuch@notmuchmail.org>; Tue,  5 Apr 2016 19:04:59 -0700 (PDT)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <david@tethera.net>)\r
22  id 1ancqa-0005cN-Jm; Tue, 05 Apr 2016 22:05:32 -0400\r
23 Received: (nullmailer pid 22295 invoked by uid 1000);\r
24  Wed, 06 Apr 2016 02:04:57 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
27  Notmuch Mail <notmuch@notmuchmail.org>\r
28 Subject: Re: [PATCH v2 5/7] Introduce _notmuch_message_has_term()\r
29 In-Reply-To: <1459606541-23889-5-git-send-email-dkg@fifthhorseman.net>\r
30 References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>\r
31  <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net>\r
32  <1459606541-23889-5-git-send-email-dkg@fifthhorseman.net>\r
33 User-Agent: Notmuch/0.21+74~g6c60fb1 (http://notmuchmail.org) Emacs/24.5.1\r
34  (x86_64-pc-linux-gnu)\r
35 Date: Tue, 05 Apr 2016 23:04:57 -0300\r
36 Message-ID: <87pou3fq5y.fsf@zancas.localnet>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.20\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43  <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
50  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Wed, 06 Apr 2016 02:05:08 -0000\r
52 \r
53 Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
54 \r
55 > It can be useful to easily tell if a given message has a given term\r
56 > associated with it.\r
57 > ---\r
58 >  lib/message.cc        | 49 +++++++++++++++++++++++++++++++++++++++++++++++++\r
59 >  lib/notmuch-private.h | 13 +++++++++++++\r
60 >  2 files changed, 62 insertions(+)\r
61 >\r
62 > diff --git a/lib/message.cc b/lib/message.cc\r
63 > index e414e9c..fab70fd 100644\r
64 > --- a/lib/message.cc\r
65 > +++ b/lib/message.cc\r
66 > @@ -1216,6 +1216,55 @@ _notmuch_message_remove_term (notmuch_message_t *message,\r
67 >      return NOTMUCH_PRIVATE_STATUS_SUCCESS;\r
68 >  }\r
69 >  \r
70 > +notmuch_bool_t\r
71 > +_notmuch_message_has_term (notmuch_message_t *message,\r
72 > +                        const char *prefix_name,\r
73 > +                        const char *value)\r
74 > +{\r
75 > +    notmuch_bool_t out;\r
76 > +    notmuch_private_status_t st =\r
77 > +     _notmuch_message_has_term_st (message, prefix_name, value, &out);\r
78 > +    if (st)\r
79 > +     return FALSE;\r
80 > +    return out;\r
81 > +}\r
82 \r
83 I second Tomi's unease with providing this interface; not having it\r
84 would also allow dropping the _st from the other function.\r
85 \r