Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / ff / 71a4c6311515d4af9fdd43b495d9ced5a7ec28
1 Return-Path: <amthrax@drake.mit.edu>\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 DED93429E34\r
6         for <notmuch@notmuchmail.org>; Thu, 17 Feb 2011 23:59:35 -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\r
12         tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 JEzmBm1BMElj for <notmuch@notmuchmail.org>;\r
16         Thu, 17 Feb 2011 23:59:35 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
18         [18.7.68.35])\r
19         by olra.theworths.org (Postfix) with ESMTP id 80B83429E35\r
20         for <notmuch@notmuchmail.org>; Thu, 17 Feb 2011 23:59:27 -0800 (PST)\r
21 X-AuditID: 12074423-b7bd0ae000000a00-c3-4d5e26df9711\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-6.mit.edu (Symantec Brightmail Gateway) with\r
24         SMTP id 7C.BE.02560.FD62E5D4; Fri, 18 Feb 2011 02:59:27 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id p1I7xQEx007704; \r
27         Fri, 18 Feb 2011 02:59:26 -0500\r
28 Received: from drake.mit.edu\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p1I7xP56001540\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Fri, 18 Feb 2011 02:59:26 -0500 (EST)\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.72)\r
36         (envelope-from <amthrax@drake.mit.edu>)\r
37         id 1PqLFN-0008LH-L6; Fri, 18 Feb 2011 02:59:25 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH 05/10] lib: Indicate if there are more filenames after\r
41  removal.\r
42 Date: Fri, 18 Feb 2011 02:58:55 -0500\r
43 Message-Id: <1298015940-31986-6-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.2.3\r
45 In-Reply-To: <1298015940-31986-1-git-send-email-amdragon@mit.edu>\r
46 References: <1298015940-31986-1-git-send-email-amdragon@mit.edu>\r
47 X-Brightmail-Tracker: AAAAAA==\r
48 Cc: amdragon@mit.edu\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Fri, 18 Feb 2011 07:59:36 -0000\r
62 \r
63 Make _notmuch_message_remove_filename return\r
64 NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID if the message has more filenames\r
65 and fix callers to handle this.\r
66 ---\r
67  lib/message.cc |   10 +++++++++-\r
68  1 files changed, 9 insertions(+), 1 deletions(-)\r
69 \r
70 diff --git a/lib/message.cc b/lib/message.cc\r
71 index 06747fe..635f5cf 100644\r
72 --- a/lib/message.cc\r
73 +++ b/lib/message.cc\r
74 @@ -480,6 +480,9 @@ _notmuch_message_add_filename (notmuch_message_t *message,\r
75   * This change will not be reflected in the database until the next\r
76   * call to _notmuch_message_sync.\r
77   *\r
78 + * If this message still has other filenames, returns\r
79 + * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID.\r
80 + *\r
81   * Note: This function does not remove a document from the database,\r
82   * even if the specified filename is the only filename for this\r
83   * message. For that functionality, see\r
84 @@ -547,6 +550,10 @@ _notmuch_message_remove_filename (notmuch_message_t *message,\r
85         if (strncmp ((*i).c_str (), direntry_prefix, direntry_prefix_len))\r
86             break;\r
87  \r
88 +       /* Indicate that there are filenames remaining. */\r
89 +       if (status == NOTMUCH_STATUS_SUCCESS)\r
90 +           status = NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID;\r
91 +\r
92         direntry = (*i).c_str ();\r
93         direntry += direntry_prefix_len;\r
94  \r
95 @@ -1235,7 +1242,8 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message)\r
96             new_status = _notmuch_message_remove_filename (message,\r
97                                                            filename);\r
98             /* Hold on to only the first error. */\r
99 -           if (! status && new_status) {\r
100 +           if (! status && new_status\r
101 +               && new_status != NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {\r
102                 status = new_status;\r
103                 continue;\r
104             }\r
105 -- \r
106 1.7.2.3\r
107 \r