[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / 10 / 137b661ec401d3c0ef3e88da8be36c912944a9
1 Return-Path: <tomi.ollila@iki.fi>\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 1127C431FC0\r
6         for <notmuch@notmuchmail.org>; Wed,  1 Jan 2014 08:30:51 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 0RBL7aHw0V9W for <notmuch@notmuchmail.org>;\r
16         Wed,  1 Jan 2014 08:30:43 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 5DFA7431FAF\r
19         for <notmuch@notmuchmail.org>; Wed,  1 Jan 2014 08:30:43 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id A63801000B2;\r
22         Wed,  1 Jan 2014 18:30:35 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH 2/2] insert: respect maildir.synchronize_flags\r
26 In-Reply-To: <1388589614-19671-2-git-send-email-jani@nikula.org>\r
27 References: <1388589614-19671-1-git-send-email-jani@nikula.org>\r
28         <1388589614-19671-2-git-send-email-jani@nikula.org>\r
29 User-Agent: Notmuch/0.17+13~gdfcf116 (http://notmuchmail.org) Emacs/24.3.1\r
30         (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Wed, 01 Jan 2014 18:30:35 +0200\r
35 Message-ID: <m2k3ejfyvo.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Wed, 01 Jan 2014 16:30:51 -0000\r
51 \r
52 On Wed, Jan 01 2014, Jani Nikula <jani@nikula.org> wrote:\r
53 \r
54 > Don't synchronize maildir flags if the user doesn't want it.\r
55 > ---\r
56 \r
57 Looks good, tests pass.\r
58 \r
59 Tomi\r
60 \r
61 \r
62 >  notmuch-insert.c | 24 ++++++++++++++++--------\r
63 >  test/insert      |  1 -\r
64 >  2 files changed, 16 insertions(+), 9 deletions(-)\r
65 >\r
66 > diff --git a/notmuch-insert.c b/notmuch-insert.c\r
67 > index 2207b1e..55384e3 100644\r
68 > --- a/notmuch-insert.c\r
69 > +++ b/notmuch-insert.c\r
70 > @@ -295,7 +295,7 @@ copy_stdin (int fdin, int fdout)\r
71 >   * The file is renamed to encode notmuch tags as maildir flags. */\r
72 >  static void\r
73 >  add_file_to_database (notmuch_database_t *notmuch, const char *path,\r
74 > -                   tag_op_list_t *tag_ops)\r
75 > +                   tag_op_list_t *tag_ops, notmuch_bool_t synchronize_flags)\r
76 >  {\r
77 >      notmuch_message_t *message;\r
78 >      notmuch_status_t status;\r
79 > @@ -323,11 +323,15 @@ add_file_to_database (notmuch_database_t *notmuch, const char *path,\r
80 >  \r
81 >      if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {\r
82 >       /* Don't change tags of an existing message. */\r
83 > -     status = notmuch_message_tags_to_maildir_flags (message);\r
84 > -     if (status != NOTMUCH_STATUS_SUCCESS)\r
85 > -         fprintf (stderr, "Error: failed to sync tags to maildir flags\n");\r
86 > +     if (synchronize_flags) {\r
87 > +         status = notmuch_message_tags_to_maildir_flags (message);\r
88 > +         if (status != NOTMUCH_STATUS_SUCCESS)\r
89 > +             fprintf (stderr, "Error: failed to sync tags to maildir flags\n");\r
90 > +     }\r
91 >      } else {\r
92 > -     tag_op_list_apply (message, tag_ops, TAG_FLAG_MAILDIR_SYNC);\r
93 > +     tag_op_flag_t flags = synchronize_flags ? TAG_FLAG_MAILDIR_SYNC : 0;\r
94 > +\r
95 > +     tag_op_list_apply (message, tag_ops, flags);\r
96 >      }\r
97 >  \r
98 >      notmuch_message_destroy (message);\r
99 > @@ -335,7 +339,8 @@ add_file_to_database (notmuch_database_t *notmuch, const char *path,\r
100 >  \r
101 >  static notmuch_bool_t\r
102 >  insert_message (void *ctx, notmuch_database_t *notmuch, int fdin,\r
103 > -             const char *dir, tag_op_list_t *tag_ops)\r
104 > +             const char *dir, tag_op_list_t *tag_ops,\r
105 > +             notmuch_bool_t synchronize_flags)\r
106 >  {\r
107 >      char *tmppath;\r
108 >      char *newpath;\r
109 > @@ -377,7 +382,7 @@ insert_message (void *ctx, notmuch_database_t *notmuch, int fdin,\r
110 >  \r
111 >      /* Even if adding the message to the notmuch database fails,\r
112 >       * the message is on disk and we consider the delivery completed. */\r
113 > -    add_file_to_database (notmuch, newpath, tag_ops);\r
114 > +    add_file_to_database (notmuch, newpath, tag_ops, synchronize_flags);\r
115 >  \r
116 >      return TRUE;\r
117 >  \r
118 > @@ -400,6 +405,7 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[])\r
119 >      char *query_string = NULL;\r
120 >      const char *folder = NULL;\r
121 >      notmuch_bool_t create_folder = FALSE;\r
122 > +    notmuch_bool_t synchronize_flags;\r
123 >      const char *maildir;\r
124 >      int opt_index;\r
125 >      unsigned int i;\r
126 > @@ -420,6 +426,7 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[])\r
127 >  \r
128 >      db_path = notmuch_config_get_database_path (config);\r
129 >      new_tags = notmuch_config_get_new_tags (config, &new_tags_length);\r
130 > +    synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);\r
131 >  \r
132 >      tag_ops = tag_op_list_create (config);\r
133 >      if (tag_ops == NULL) {\r
134 > @@ -471,7 +478,8 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[])\r
135 >                              NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch))\r
136 >       return 1;\r
137 >  \r
138 > -    ret = insert_message (config, notmuch, STDIN_FILENO, maildir, tag_ops);\r
139 > +    ret = insert_message (config, notmuch, STDIN_FILENO, maildir, tag_ops,\r
140 > +                       synchronize_flags);\r
141 >  \r
142 >      notmuch_database_destroy (notmuch);\r
143 >  \r
144 > diff --git a/test/insert b/test/insert\r
145 > index 9283e70..e8dc4c0 100755\r
146 > --- a/test/insert\r
147 > +++ b/test/insert\r
148 > @@ -114,7 +114,6 @@ dirname=$(dirname "$output")\r
149 >  test_expect_equal "$dirname" "$MAIL_DIR/cur"\r
150 >  \r
151 >  test_begin_subtest "Insert message with maildir sync off goes to new/"\r
152 > -test_subtest_known_broken\r
153 >  OLDCONFIG=$(notmuch config get maildir.synchronize_flags)\r
154 >  notmuch config set maildir.synchronize_flags false\r
155 >  gen_insert_msg\r
156 > -- \r
157 > 1.8.5.2\r
158 >\r
159 > _______________________________________________\r
160 > notmuch mailing list\r
161 > notmuch@notmuchmail.org\r
162 > http://notmuchmail.org/mailman/listinfo/notmuch\r