From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1D83D429E3B for ; Sat, 11 Jun 2011 13:06:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f4e4Exica7AP for ; Sat, 11 Jun 2011 13:06:53 -0700 (PDT) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id 6EA74429E26 for ; Sat, 11 Jun 2011 13:06:53 -0700 (PDT) X-AuditID: 1209190c-b7c65ae00000117c-a2-4df3cae43456 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id BB.71.04476.4EAC3FD4; Sat, 11 Jun 2011 16:07:00 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id p5BK6qrD013147; Sat, 11 Jun 2011 16:06:52 -0400 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p5BK6pBU006021 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 11 Jun 2011 16:06:52 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.76) (envelope-from ) id 1QVUSJ-0000IF-NZ; Sat, 11 Jun 2011 16:06:51 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 09/17] lib: Indicate if there are more filenames after removal. Date: Sat, 11 Jun 2011 16:04:35 -0400 Message-Id: <1307822683-848-10-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1307822683-848-1-git-send-email-amdragon@mit.edu> References: <87ei34rnc5.fsf@yoom.home.cworth.org> <1307822683-848-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsUixCmqrfvk1Gdfg92rZC2u35zJ7MDo8WzV LeYAxigum5TUnMyy1CJ9uwSujM7NX5kK9vJULFj0mrGBsYmri5GTQ0LARGLT0mksELaYxIV7 69m6GLk4hAT2MUq8fdLBBOFsYJSYdn4ClHOfSWL6um4oZz6jRHvzTiaQfjYBDYlt+5czgtgi AtISO+/OZu1i5OBgFlCT+NOlAhIWFvCX+L3uPTOIzSKgKrF6+Q5WEJtXwF5iad8NJogzFCSu XJkHdhInUHzewatgtpBAmsSSW7vZJzDyL2BkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRrqJeb WaKXmlK6iREcNpI8OxjfHFQ6xCjAwajEw6u49rOvEGtiWXFl7iFGSQ4mJVFenRNAIb6k/JTK jMTijPii0pzU4kOMEhzMSiK869s/+QrxpiRWVqUW5cOkpDlYlMR5Z0iq+woJpCeWpGanphak FsFkZTg4lCR4JYHxISRYlJqeWpGWmVOCkGbi4AQZzgM0/OhJoBre4oLE3OLMdIj8KUZdjscb Nh1iFGLJy89LlRLnVQcZJABSlFGaBzcHFu+vGMWB3hLm/QEyigeYKuAmvQJawgS0RKAUbElJ IkJKqoEx9KiUrFJj60rBPos05j7elcme58qrbEMdNedt0dbb/W1y6KXzh4Ml1zSvWKcTcKH7 t3JKp5vvotyThamlbuvfC8yZNe92ceu8a9uzMmZ7e/062/JI6foJvo/T/zx7KG9zRsHJN0pS 9+2/35sWPt090eTmsqhFD55ds70mYniDy33q63lJta4vlFiKMxINtZiLihMBpl8IqtICAAA= Cc: Austin Clements X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2011 20:06:54 -0000 Make _notmuch_message_remove_filename return NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID if the message has more filenames and fix callers to handle this. --- lib/message.cc | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/lib/message.cc b/lib/message.cc index afb1d80..5120b3a 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -501,6 +501,9 @@ _notmuch_message_add_filename (notmuch_message_t *message, * This change will not be reflected in the database until the next * call to _notmuch_message_sync. * + * If this message still has other filenames, returns + * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID. + * * Note: This function does not remove a document from the database, * even if the specified filename is the only filename for this * message. For that functionality, see @@ -565,6 +568,9 @@ _notmuch_message_remove_filename (notmuch_message_t *message, if (strncmp ((*i).c_str (), direntry_prefix, direntry_prefix_len)) break; + /* Indicate that there are filenames remaining. */ + status = NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID; + direntry = (*i).c_str (); direntry += direntry_prefix_len; @@ -1257,7 +1263,8 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message) new_status = _notmuch_message_remove_filename (message, filename); /* Hold on to only the first error. */ - if (! status && new_status) { + if (! status && new_status + && new_status != NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) { status = new_status; continue; } -- 1.7.5.1