[PATCH 2/2] Include 'unread' tag only to mails in new
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 20 Nov 2010 23:27:40 +0000 (00:27 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:34 +0000 (09:37 -0800)
9f/b4102f411994484befd8cd9b11358ebfe4df51 [new file with mode: 0644]

diff --git a/9f/b4102f411994484befd8cd9b11358ebfe4df51 b/9f/b4102f411994484befd8cd9b11358ebfe4df51
new file mode 100644 (file)
index 0000000..be2f611
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2A19840DDC2\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 15:28:07 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Fy9O07VicXNe for <notmuch@notmuchmail.org>;\r
+       Sat, 20 Nov 2010 15:27:53 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 51FE640DEEC\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 15:27:53 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id A9ADD19F3356;\r
+       Sun, 21 Nov 2010 00:27:52 +0100 (CET)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id b86LBBIQJ7FU; Sun, 21 Nov 2010 00:27:51 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id EFE3E19F3363;\r
+       Sun, 21 Nov 2010 00:27:50 +0100 (CET)\r
+Received: from wsheee.2x.cz (unknown [213.29.198.144])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id ECD29FA003;\r
+       Sun, 21 Nov 2010 00:27:50 +0100 (CET)\r
+Received: from wsh by wsheee.2x.cz with local (Exim 4.72)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1PJwqU-0000Ox-Gx; Sun, 21 Nov 2010 00:27:50 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] Include 'unread' tag only to mails in new\r
+Date: Sun, 21 Nov 2010 00:27:40 +0100\r
+Message-Id: <1290295660-1508-2-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.1.90.g94d6d4\r
+In-Reply-To: <87pqtzk254.fsf@wsheee.2x.cz>\r
+References: <87pqtzk254.fsf@wsheee.2x.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 20 Nov 2010 23:28:07 -0000\r
+\r
+Ruben's previous patch fixed the problem that he experienced, but it\r
+also caused the test "Removing info from filename leaves tags unchanged"\r
+to fail. This is an attempt to make all tests to pass.\r
+\r
+The Ruben's change is restricted to be only effective in 'new' directory.\r
+---\r
+ lib/message.cc |    9 +++++++--\r
+ 1 files changed, 7 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/lib/message.cc b/lib/message.cc\r
+index 996c1df..e769bf5 100644\r
+--- a/lib/message.cc\r
++++ b/lib/message.cc\r
+@@ -905,6 +905,7 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)\r
+     char *combined_flags = talloc_strdup (message, "");\r
+     unsigned i;\r
+     int seen_maildir_info = 0;\r
++    const char *dir;\r
\r
+     for (filenames = notmuch_message_get_filenames (message);\r
+        notmuch_filenames_valid (filenames);\r
+@@ -912,13 +913,17 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)\r
+     {\r
+       filename = notmuch_filenames_get (filenames);\r
\r
+-      if (! _filename_is_in_maildir(filename))\r
++      dir = _filename_is_in_maildir(filename);\r
++      if (! dir)\r
+           continue;\r
+-      seen_maildir_info = 1;\r
++\r
++      if (STRNCMP_LITERAL (dir, "new/") == 0)\r
++          seen_maildir_info = 1;\r
\r
+       flags = strstr (filename, ":2,");\r
+       if (! flags)\r
+           continue;\r
++      seen_maildir_info = 1;\r
\r
+       flags += 3;\r
\r
+-- \r
+1.7.1.90.g94d6d4\r
+\r