[PATCH v4 5/7] Introduce _notmuch_message_has_term()
[notmuch-archives.git] / 3a / 2c38be456ddb0c862cf181b49d9f291fef0bac
1 Return-Path: <jrollins@finestructure.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 olra.theworths.org (Postfix) with ESMTP id 96CB0431FCB\r
6         for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:10 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id L7SPgE6WMATL for <notmuch@notmuchmail.org>;\r
16         Sun, 19 Aug 2012 18:53:09 -0700 (PDT)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id 0698A431FBF\r
20         for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:08 -0700 (PDT)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id C5A7C66E00DE\r
23         for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:07 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (unknown [76.89.192.57])\r
26         (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id 99F9A66E00D1\r
28         for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:05 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id D42D98E8; Sun, 19 Aug 2012 18:53:03 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH 05/11] lib: add ability to store recipients in message\r
34         structure\r
35 Date: Sun, 19 Aug 2012 18:52:44 -0700\r
36 Message-Id: <1345427570-26518-6-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.10.4\r
38 In-Reply-To: <1345427570-26518-5-git-send-email-jrollins@finestructure.net>\r
39 References: <1345427570-26518-1-git-send-email-jrollins@finestructure.net>\r
40         <1345427570-26518-2-git-send-email-jrollins@finestructure.net>\r
41         <1345427570-26518-3-git-send-email-jrollins@finestructure.net>\r
42         <1345427570-26518-4-git-send-email-jrollins@finestructure.net>\r
43         <1345427570-26518-5-git-send-email-jrollins@finestructure.net>\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Mon, 20 Aug 2012 01:53:11 -0000\r
57 \r
58 Added as a string, in parallel to the authors element.\r
59 ---\r
60  lib/message.cc        |   18 ++++++++++++++++++\r
61  lib/notmuch-private.h |    9 +++++++++\r
62  2 files changed, 27 insertions(+)\r
63 \r
64 diff --git a/lib/message.cc b/lib/message.cc\r
65 index 978de06..fa28073 100644\r
66 --- a/lib/message.cc\r
67 +++ b/lib/message.cc\r
68 @@ -36,6 +36,7 @@ struct visible _notmuch_message {\r
69      notmuch_string_list_t *filename_term_list;\r
70      notmuch_string_list_t *filename_list;\r
71      char *author;\r
72 +    char *recipients;\r
73      notmuch_message_file_t *message_file;\r
74      notmuch_message_list_t *replies;\r
75      unsigned long flags;\r
76 @@ -109,6 +110,7 @@ _notmuch_message_create_for_document (const void *talloc_owner,\r
77      message->filename_list = NULL;\r
78      message->message_file = NULL;\r
79      message->author = NULL;\r
80 +    message->recipients = NULL;\r
81  \r
82      message->replies = _notmuch_message_list_create (message);\r
83      if (unlikely (message->replies == NULL)) {\r
84 @@ -808,6 +810,22 @@ notmuch_message_set_author (notmuch_message_t *message,\r
85      return;\r
86  }\r
87  \r
88 +const char *\r
89 +notmuch_message_get_recipients (notmuch_message_t *message)\r
90 +{\r
91 +    return message->recipients;\r
92 +}\r
93 +\r
94 +void\r
95 +notmuch_message_set_recipients (notmuch_message_t *message,\r
96 +                               const char *recipients)\r
97 +{\r
98 +    if (message->recipients)\r
99 +       talloc_free(message->recipients);\r
100 +    message->recipients = talloc_strdup(message, recipients);\r
101 +    return;\r
102 +}\r
103 +\r
104  void\r
105  _notmuch_message_set_header_values (notmuch_message_t *message,\r
106                                     const char *date,\r
107 diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
108 index bfb4111..27a41b6 100644\r
109 --- a/lib/notmuch-private.h\r
110 +++ b/lib/notmuch-private.h\r
111 @@ -325,6 +325,15 @@ notmuch_message_set_author (notmuch_message_t *message, const char *author);\r
112  const char *\r
113  notmuch_message_get_author (notmuch_message_t *message);\r
114  \r
115 +/* Set the recipients of 'message' - this is the representation used\r
116 + * when displaying the message */\r
117 +void\r
118 +notmuch_message_set_recipients (notmuch_message_t *message, const char *recipients);\r
119 +\r
120 +/* Get the authors of 'message' */\r
121 +const char *\r
122 +notmuch_message_get_recipients (notmuch_message_t *message);\r
123 +\r
124  \r
125  /* index.cc */\r
126  \r
127 -- \r
128 1.7.10.4\r
129 \r