Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 077D9431FAE for ; Sat, 9 Jun 2012 12:14:58 -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 xIwGjTgjJGXe for ; Sat, 9 Jun 2012 12:14:57 -0700 (PDT) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id 646DB431FBF for ; Sat, 9 Jun 2012 12:14:55 -0700 (PDT) X-AuditID: 12074424-b7f826d000000926-39-4fd3a0ae72db Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id FF.16.02342.EA0A3DF4; Sat, 9 Jun 2012 15:14:54 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q59JErsL015442; Sat, 9 Jun 2012 15:14:53 -0400 Received: from drake.dyndns.org (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 q59JEq3g026106 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 9 Jun 2012 15:14:53 -0400 (EDT) Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1SdR75-0000wt-Nq; Sat, 09 Jun 2012 15:14:19 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v2 3/5] lib: Only synchronize maildir flags for messages in maildirs Date: Sat, 9 Jun 2012 15:14:16 -0400 Message-Id: <1339269258-3542-4-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1339269258-3542-1-git-send-email-amdragon@mit.edu> References: <1338742656-11640-1-git-send-email-amdragon@mit.edu> <1339269258-3542-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixCmqrLtuwWV/g6vHjC2apjtbXL85k9mB yePW/dfsHs9W3WIOYIrisklJzcksSy3St0vgyjiwcS57wUvuitn9P9gbGA9zdjFyckgImEi0 3fzFCmGLSVy4t56ti5GLQ0hgH6PEr2v3GCGc9YwSj/ecYoZwHjJJ9O5ohSqbyyjxovU3O0g/ m4CGxLb9yxlBbBEBaYmdd2cDzeXgYBYwl7jZEgcSFhYIkXj96ANYCYuAqsTpc5fYQGxeAXuJ u+37oc6Ql3h6vw8szingIPHs+3SweiGBMolnp2ezTWDkX8DIsIpRNiW3Sjc3MTOnODVZtzg5 MS8vtUjXXC83s0QvNaV0EyMokNhdVHYwNh9SOsQowMGoxMOrJX/JX4g1say4MvcQoyQHk5Io 75f5l/2F+JLyUyozEosz4otKc1KLDzFKcDArifBuZQIq501JrKxKLcqHSUlzsCiJ86ZynfUX EkhPLEnNTk0tSC2CycpwcChJ8DIBI0ZIsCg1PbUiLTOnBCHNxMEJMpwHaPgbkMW8xQWJucWZ 6RD5U4yKUuK830ESAiCJjNI8uF5YpL9iFAd6RZj3J0gVDzBJwHW/AhrMBDS4NeoCyOCSRISU VANjWG9CUbzB5pz57/OPV3+b/3T+W6fXVyZM+L3P/vScGWbaJicXRz/dMf/PiqszrQ9/3F6o lXm8dNPn+kjrR2maqs536mUDCwU5clbmzxNIPPCtr1TiodeTwsNbD5+Zb8fTHdv5dY7S2Xbm uDDr0yXvVN4pqh/lf7o8TePlZhvOev2vKy1LQ4LilFiKMxINtZiLihMBb3nB6s8CAAA= 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, 09 Jun 2012 19:14:58 -0000 Previously, we synchronized flags to tags for any message that looked like it had maildir flags in its file name, regardless of whether it was in a maildir-like directory structure. This was asymmetric with tag-to-flag synchronization, which only applied to messages in directories named new/ and cur/ (introduced by 95dd5fe5). This change makes our interpretation stricter and addresses this asymmetry by only synchronizing flags to tags for messages in directories named new/ or cur/. It also prepares us to treat messages in new/ as maildir messages, even though they lack maildir flags. --- lib/message.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/message.cc b/lib/message.cc index ed96477..bbac2ff 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -1074,7 +1074,7 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message) const char *flags; notmuch_status_t status; notmuch_filenames_t *filenames; - const char *filename; + const char *filename, *dir; char *combined_flags = talloc_strdup (message, ""); unsigned i; int seen_maildir_info = 0; @@ -1084,6 +1084,10 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message) notmuch_filenames_move_to_next (filenames)) { filename = notmuch_filenames_get (filenames); + dir = _filename_is_in_maildir (filename); + + if (! dir) + continue; flags = strstr (filename, ":2,"); if (! flags) -- 1.7.10