Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / 81 / aa5b57cbca6e363417ed42f255799e9b15e8ef
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 7D521431FAF\r
6         for <notmuch@notmuchmail.org>; Tue, 22 May 2012 18:44:02 -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 xn1IBwp3QjrF for <notmuch@notmuchmail.org>;\r
16         Tue, 22 May 2012 18:44:01 -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 B12C5431FC0\r
20         for <notmuch@notmuchmail.org>; Tue, 22 May 2012 18:43:58 -0700 (PDT)\r
21 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by fire-doxen-postvirus (Postfix) with ESMTP id 47AE932803D\r
23         for <notmuch@notmuchmail.org>; Tue, 22 May 2012 18:43:56 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
25 Received: from finestructure.net (gwave-125.ligo.caltech.edu\r
26  [131.215.114.125])     (Authenticated sender: jrollins)        by fire-doxen-submit\r
27  (Postfix) with ESMTP id 5542832800B    for <notmuch@notmuchmail.org>; Tue, 22\r
28  May 2012 18:43:54 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id 390C61E1; Tue, 22 May 2012 18:43:54 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH v3 3/6] cli: modify mime_node_open to take new crypto struct\r
34         as argument\r
35 Date: Tue, 22 May 2012 18:43:47 -0700\r
36 Message-Id: <1337737430-21160-4-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.10\r
38 In-Reply-To: <1337737430-21160-3-git-send-email-jrollins@finestructure.net>\r
39 References: <1337737430-21160-1-git-send-email-jrollins@finestructure.net>\r
40         <1337737430-21160-2-git-send-email-jrollins@finestructure.net>\r
41         <1337737430-21160-3-git-send-email-jrollins@finestructure.net>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Wed, 23 May 2012 01:44:02 -0000\r
55 \r
56 This simplifies the interface considerably, getting rid of #ifdefs\r
57 along the way.\r
58 ---\r
59  mime-node.c      |   11 +++--------\r
60  notmuch-client.h |   14 +++++---------\r
61  notmuch-reply.c  |    6 ++----\r
62  notmuch-show.c   |    3 +--\r
63  4 files changed, 11 insertions(+), 23 deletions(-)\r
64 \r
65 diff --git a/mime-node.c b/mime-node.c\r
66 index a95bdab..183ff5d 100644\r
67 --- a/mime-node.c\r
68 +++ b/mime-node.c\r
69 @@ -61,12 +61,7 @@ _mime_node_context_free (mime_node_context_t *res)\r
70  \r
71  notmuch_status_t\r
72  mime_node_open (const void *ctx, notmuch_message_t *message,\r
73 -#ifdef GMIME_ATLEAST_26\r
74 -               GMimeCryptoContext *cryptoctx,\r
75 -#else\r
76 -               GMimeCipherContext *cryptoctx,\r
77 -#endif\r
78 -               notmuch_bool_t decrypt, mime_node_t **root_out)\r
79 +               notmuch_crypto_t *crypto, mime_node_t **root_out)\r
80  {\r
81      const char *filename = notmuch_message_get_filename (message);\r
82      mime_node_context_t *mctx;\r
83 @@ -118,8 +113,8 @@ mime_node_open (const void *ctx, notmuch_message_t *message,\r
84         goto DONE;\r
85      }\r
86  \r
87 -    mctx->cryptoctx = cryptoctx;\r
88 -    mctx->decrypt = decrypt;\r
89 +    mctx->cryptoctx = crypto->gpgctx;\r
90 +    mctx->decrypt = crypto->decrypt;\r
91  \r
92      /* Create the root node */\r
93      root->part = GMIME_OBJECT (mctx->mime_message);\r
94 diff --git a/notmuch-client.h b/notmuch-client.h\r
95 index 86c9697..94af8f7 100644\r
96 --- a/notmuch-client.h\r
97 +++ b/notmuch-client.h\r
98 @@ -351,9 +351,10 @@ struct mime_node {\r
99  };\r
100  \r
101  /* Construct a new MIME node pointing to the root message part of\r
102 - * message.  If cryptoctx is non-NULL, it will be used to verify\r
103 - * signatures on any child parts.  If decrypt is true, then cryptoctx\r
104 - * will additionally be used to decrypt any encrypted child parts.\r
105 + * message.  If crypto->gpgctx is non-NULL, it will be used to verify\r
106 + * signatures on any child parts.  If crypto->decrypt is true, then\r
107 + * crypto.gpgctx will additionally be used to decrypt any encrypted\r
108 + * child parts.\r
109   *\r
110   * Return value:\r
111   *\r
112 @@ -365,12 +366,7 @@ struct mime_node {\r
113   */\r
114  notmuch_status_t\r
115  mime_node_open (const void *ctx, notmuch_message_t *message,\r
116 -#ifdef GMIME_ATLEAST_26\r
117 -               GMimeCryptoContext *cryptoctx,\r
118 -#else\r
119 -               GMimeCipherContext *cryptoctx,\r
120 -#endif\r
121 -               notmuch_bool_t decrypt, mime_node_t **node_out);\r
122 +               notmuch_crypto_t *crypto, mime_node_t **node_out);\r
123  \r
124  /* Return a new MIME node for the requested child part of parent.\r
125   * parent will be used as the talloc context for the returned child\r
126 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
127 index 41b18e4..148152c 100644\r
128 --- a/notmuch-reply.c\r
129 +++ b/notmuch-reply.c\r
130 @@ -544,8 +544,7 @@ notmuch_reply_format_default(void *ctx,\r
131         g_object_unref (G_OBJECT (reply));\r
132         reply = NULL;\r
133  \r
134 -       if (mime_node_open (ctx, message, params->crypto.gpgctx, params->crypto.decrypt,\r
135 -                           &root) == NOTMUCH_STATUS_SUCCESS) {\r
136 +       if (mime_node_open (ctx, message, &(params->crypto), &root) == NOTMUCH_STATUS_SUCCESS) {\r
137             format_part_reply (root);\r
138             talloc_free (root);\r
139         }\r
140 @@ -574,8 +573,7 @@ notmuch_reply_format_json(void *ctx,\r
141  \r
142      messages = notmuch_query_search_messages (query);\r
143      message = notmuch_messages_get (messages);\r
144 -    if (mime_node_open (ctx, message, params->crypto.gpgctx, params->crypto.decrypt,\r
145 -                       &node) != NOTMUCH_STATUS_SUCCESS)\r
146 +    if (mime_node_open (ctx, message, &(params->crypto), &node) != NOTMUCH_STATUS_SUCCESS)\r
147         return 1;\r
148  \r
149      reply = create_reply_message (ctx, config, message, reply_all);\r
150 diff --git a/notmuch-show.c b/notmuch-show.c\r
151 index cc509a6..fb5e9b6 100644\r
152 --- a/notmuch-show.c\r
153 +++ b/notmuch-show.c\r
154 @@ -810,8 +810,7 @@ show_message (void *ctx,\r
155      mime_node_t *root, *part;\r
156      notmuch_status_t status;\r
157  \r
158 -    status = mime_node_open (local, message, params->crypto.gpgctx,\r
159 -                            params->crypto.decrypt, &root);\r
160 +    status = mime_node_open (local, message, &(params->crypto), &root);\r
161      if (status)\r
162         goto DONE;\r
163      part = mime_node_seek_dfs (root, (params->part < 0 ? 0 : params->part));\r
164 -- \r
165 1.7.10\r
166 \r